Question: Write in R code. A) Using the 'iris' dataset, build a polynomial model of degree 5 for the petal length as a function of petal

Write in R code. A) Using the 'iris' dataset, build a polynomial model of degree 5 for the petal length as a function of petal width. Are any of the coefficients statistically equal to zero? Display the summary and answer below. Copy and paste the simple linear model built in the last lab for the petal length as a function of petal width and display its summary. Compare with the polynomial of order 5 build before in terms of R"2 and adjusted R"2 b) Consider the following predictors (this will preview nicely on the knitted version): $Z_1=$ 'rm', $Z_Z=$ 'tax', $Z_3=$ 'dis', $Z_4=$ 'lstat', $Z_5=$ 'chas', $Z_6=$ 'crim'. With them, define the following regressors $$X_i=Z_i \\mbox{ for }i=1,2,3,4,5 $$ QXg==2lbri ==1,2,3,4,5 $$X_6=\\sqrt{Z_6}, x_7=z_4A2, X_8=Z_1Z_2, x_9=z_1z_3$$ X6 : 1/z, X7 = 23, X3 = 2122, X9 = 2123 Build a linear model explaining median house value according to those 9 regressors. Is the mod significant? Which of its coefficients are statistically different from 0? Build a new model removing $Z_3$ and all regressors depending on it from the previous model. Compare the two models according to the criteria seen in lecture. Build a histogram of the residuals of this last model and put a normal distribution curve on top of them. Is the normalitv of errors assumption met here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
