In: Statistics and Probability
Please use R to solve and explain fully
Market Planning, Inc., a marketing research firm, has obtained the prescription sales data in the table below for n = 20 independent pharmacies.
These variables can be described precisely as follows:
y = average weekly prescription sales over the past year (in units of $1000)
x1 = floor space (in square feet)
x2= percent of floor space allocated to the prescription department
x3 = number of parking spaces available for the store
x4 = monthly per capita income for the surrounding community (in units of $100)
x5 is an independent variable that equals 1 if the pharmacy is located in a shopping center and equals 0 otherwise (x5 is called a dummy variable)
a. Output the stepwise regression of the data in this exercise. Set, both alphaentry and alphastay equal to .15. What is the final model arrived at by stepwise regression?
b. Perform a backward elimination procedure on the same data. Describe the order in which the independent variables are removed by the backward elimination procedure.
c. Is the model arrived at by backward elimination the same as the model arrived at by stepwise regression?
Pharmacy |
y |
x1 |
x2 |
x3 |
x4 |
x5 |
1 |
22 |
4900 |
9 |
40 |
18 |
1 |
2 |
19 |
5800 |
10 |
50 |
20 |
1 |
3 |
24 |
5000 |
11 |
55 |
17 |
1 |
4 |
28 |
4400 |
12 |
30 |
19 |
0 |
5 |
18 |
3850 |
13 |
42 |
10 |
0 |
6 |
21 |
5300 |
15 |
20 |
22 |
1 |
7 |
29 |
4100 |
20 |
25 |
8 |
0 |
8 |
15 |
4700 |
22 |
60 |
15 |
1 |
9 |
12 |
5600 |
24 |
45 |
16 |
1 |
10 |
14 |
4900 |
27 |
82 |
14 |
1 |
11 |
18 |
3700 |
28 |
56 |
12 |
0 |
12 |
19 |
3800 |
31 |
38 |
8 |
0 |
13 |
15 |
2400 |
36 |
35 |
6 |
0 |
14 |
22 |
1800 |
37 |
28 |
4 |
0 |
15 |
13 |
3100 |
40 |
43 |
6 |
0 |
16 |
16 |
2300 |
41 |
20 |
5 |
0 |
17 |
8 |
4400 |
42 |
46 |
7 |
1 |
18 |
6 |
3300 |
42 |
15 |
4 |
0 |
19 |
7 |
2900 |
45 |
30 |
9 |
1 |
20 |
17 |
2400 |
46 |
16 |
3 |
0 |
Answer for part (a) : Final model arrived by stepwise regression is in orange box in the below picture.
Answer for part (b) : Backward Elimination :
Order in which independent variables are removed is :
1st removed : x4
2nd removed : x3
3rd removed : x1
You can see this removal order in below picture(See step-2,step-3,step-4 respectively. You can see values for removed variables are not available.).Also the final regression model is in orange box.
Answer for part (c) : The model arrived by backward elimination and stepwise regression is same. (You can see orange boxes.)