Question: i ) Generate a response Y and two predictors x 1 and x 2 , with n = 1 0 0 ii ) Initialize 1

i) Generate a response Y and two predictors x1 and x2, with n=100
ii) Initialize 1 to take on a value of your choice. It does not matter what
value you choose.
iii) Keeping 1 fixed, fit the model Y-1x1=2+x2+
iv) Keeping , fixed, fit the model Y-2x2=0+1x1+
v) Write a for loop to repeat (iii) and (iv)1000 times. Report the estimates
of 0,1 and 2 at each iteration of the for loop. Create a plot in which
each of these values is displayed, with 0,1, and 2 each shown in a
different color.
vi) Compare your answer in (v) to the results of simply performing multiple
linear regression to predict Y using x1 and x2. Use the abline() function
to overlay those multiple linear regression coefficient estimates on the
plot obtained in (v).
 i) Generate a response Y and two predictors x1 and x2,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!