daviddalpiaz / appliedstats

:bar_chart: Methods of Applied Statistics Course Textbook Repository
https://book.stat420.org/
158 stars 171 forks source link

diagnostics.Rmd : X multiplied twice by 5 #59

Closed iHrushikesh closed 6 years ago

iHrushikesh commented 6 years ago

The model is Y = 3 + 5x + eps, but in the sim function the x was multiplied by 5 twice, once in rnorm and second time while calculating Y. I removed the former one to correct.

daviddalpiaz commented 6 years ago

The former actually really isn't part of the model. It is part of the creation of the predictor variable. By multiplying by 5 there, the predictor takes values between 0 and 5 instead of 0 and 1. (I can see how this is confusing since 5 is used for both this and the model.)