Question: 8. In this exercise we will apply backward elimination, at p-to-remove 0.1, for variable selection on the state data set described in Exercise 3 in

8. In this exercise we will apply backward elimination, at p-to-remove 0.1, for variable selection on the “state” data set described in Exercise 3 in Section 12.3. Stepwise variable selection with p-to-remove (or p-to-enter) of your choice is not automatic in R, but the process is greatly facilitated by the update function described in Exercise 3 in Section 12.3. Use st=read.table(”State.txt”, header=T)

to import the data into the R data frame st and complete the following.

(a) Use h=lm(Life.Exp∼ . , data=st); summary(h) to fit the full model. (Here “.” means “use all predictors in the data set.”) Because the largest p-value, which is 0.965, corresponds to “Area” and is > 0.1, continue with h=update(h, . ∼ . -Area); summary(h) to fit the model without the predictor “Area.”

(b) Continue removing the predictor with the largest p-value until all p-values are smaller than 0.1. Give the R2 for the final model and compare it with that of the full model.

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 Bayesian Statistics An Introduction Questions!