Question: Using R, please simulate continuous data for y1, x1, x2, x3, x4, x5, x6. Then, a) Using the best subset selection method by writing your

Using R, please simulate continuous data for y1, x1, x2, x3, x4, x5, x6. Then,

Using R, please simulate continuous data for y1, x1, x2, x3, x4,

a) Using the best subset selection method by writing your own loop, 1.e., consider all possible combination of covariates (yx1,yx1+x2,,yx1+x2+x3+x4+x5+x6), choose the best model based on the BIC criterion. Write down your final model. Note that BIC stands for Bayesian Information Criterion, which can be used to compare models. BIC=2loglikelihood+plog(n) where p is the number of parameters. The smaller the BIC, the better is the model fit. b) The function regsubsets () in R package leaps will perform best subset selection. Repeat (a) by using regsubsets ()

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!