06.09.2021 Views

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

at an annual interest rate of 5%. The mortgage is a 30 year loan, so they need to pay it off <strong>with</strong>in 360 months<br />

total. Our happy couple decide to set their monthly mortgage payment at $1600 per month. Will they pay off<br />

the loan in time or not? Only time will tell. 3 Or, alternatively, we could simulate the whole process <strong>and</strong> get R to<br />

tell us. The script to run this is a fair bit more complicated.<br />

mortgage.R<br />

1 # set up<br />

2 month

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!