Question: I am having trouble writing a code for each selection and am unsure what the responsible variable is. R studio codes for forward selection, backward

I am having trouble writing a code for each selection and am unsure what the responsible variable is. R studio codes for forward selection, backward selection, and sequential replacement. Please help!

Association mapping sometimes can be analyzed by multiple linear regression analysis. In this assignment, there are 48 original independent variables (0-1 from DNA markers) and Y, a wing shape index, from 701 recombinant isogenic lines related to chromosome 2 of the common fruit fly. The data are from Weber, K., R. Eisman, S. Higgins, L. Morey, A. Patty, M. Tausek and Z.-B. Zeng (2001), "An Analysis of Polygenes Affecting Wing Shape on Chromosome 2 in Drosophila Melanogaster," Genetics, 159, 1045-1057. You may read the paper for detailed information. After deleting redundant variables x8, x19, x20, x21, x22, x25, x26, x28, x29, x32, and x47, there are 37 remaining variables in the data set which is available in D2L (zengmarker.txt) or in the coursedata package (data(zeng)). With the data set, please conduct multiple linear regression analyses using the following commonly used variable selection approaches and summarize your results from these variable selection methods which are available in the package leaps. MUST USE THE LEAPS PACKAGE EXAMPLES IN R STUDIO TO WRITE THE CODE.

Below is a screenshot of the variable columns.

Thank you for your help!I am having trouble writing a code for each selection and am

1 2 3 x4 X5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 x7 9 10 X11 x12 13 14 x15 x16 17 x18 23 x24 x27 x30 x31 x33 x34 3536 x37 x38 39 x40 x41 x42 x43 x44 x45x46 x48 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0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 1 1 1 1 1 1 1 -0.0062 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0030 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0049 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0044 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0018 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.0012 0 0 0 0 0 0 0 0 -0.0546 0 0 0 0 0 0 0 0 0 0 0 0 -0.0526 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0530 0 0 0 0 0 0 -0.0535 0 0 0 0 0 -0.0569 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0539 0 0 0 o o o o o o 0 0 0 0 -0.0563 0 -0.0582 0 0 0 0 0 0 0 0 -0.0452 1 0 0 0 0 0 0 0 0 0 0 0 -0.0559 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.0573 1 1 0 0 0 0 0 0 -0.0485 1 1 1 0 0 0 0 -0.0460 ooooooooooooope 1 HHHHHHHHOOOOOOOOOOOOO HHHHHHHHOOOOOOOOOOOOO

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 Accounting Questions!