STAT3002 Week 5

 

5.4 Stepwise regression (continued)

 

Using the ‘step’ function

 


> null.model <- lm(Deviation~1)

> final.model <- step(null.model,~Ceiling+Contracts+LogItems+Months+Price+Share+Target03+Year)

Start:  AIC= 14651.11

 Deviation ~ 1

 

Single term additions

 

Model:

Deviation ~ 1

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              14486.50 14651.11

  Ceiling  1    99.308 14387.19 14716.43

Contracts  1  1090.452 13396.04 13725.28

 LogItems  1   148.035 14338.46 14667.70

   Months  1   161.706 14324.79 14654.03

    Price  1   247.665 14238.83 14568.07

    Share  1   243.842 14242.65 14571.89

 Target03  1    10.581 14475.91 14805.15

     Year  1   879.234 13607.26 13936.50

 

Step:  AIC= 13725.28

 Deviation ~ Contracts

 

Single term deletions

 

Model:

Deviation ~ Contracts

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              13396.04 13725.28

Contracts  1  1090.452 14486.50 14651.11

Single term additions

 

Model:

Deviation ~ Contracts

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              13396.04 13725.28

 Ceiling  1  679.3681 12716.67 13210.53

LogItems  1  335.7067 13060.34 13554.19

  Months  1  667.4598 12728.58 13222.44

   Price  1  802.3963 12593.65 13087.50

   Share  1  368.6761 13027.37 13521.22

Target03  1    2.2263 13393.82 13887.67

    Year  1   45.8213 13350.22 13844.08

 

Step:  AIC= 13087.5

 Deviation ~ Contracts + Price

 

Single term deletions

 

Model:

Deviation ~ Contracts + Price

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              12593.65 13087.50

Contracts  1  1645.184 14238.83 14568.07

    Price  1   802.396 13396.04 13725.28

Single term additions

 

Model:

Deviation ~ Contracts + Price

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              12593.65 13087.50

 Ceiling  1  422.4574 12171.19 12829.67

LogItems  1  202.0002 12391.65 13050.12

  Months  1  497.3784 12096.27 12754.75

   Share  1  133.1216 12460.52 13119.00

Target03  1   21.8221 12571.82 13230.30

    Year  1   60.5533 12533.09 13191.57

 

Step:  AIC= 12754.75

 Deviation ~ Contracts + Price + Months

 

Single term deletions

 

Model:

Deviation ~ Contracts + Price + Months

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              12096.27 12754.75

Contracts  1  2055.737 14152.01 14645.86

    Price  1   632.315 12728.58 13222.44

   Months  1   497.378 12593.65 13087.50

Single term additions

 

Model:

Deviation ~ Contracts + Price + Months

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              12096.27 12754.75

 Ceiling  1  335.8458 11760.42 12583.52

LogItems  1  222.3423 11873.93 12697.02

   Share  1   42.7484 12053.52 12876.62

Target03  1  317.5292 11778.74 12601.84

    Year  1  244.7626 11851.51 12674.60

 

Step:  AIC= 12583.52

 Deviation ~ Contracts + Price + Months + Ceiling

 

Single term deletions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              11760.42 12583.52

Contracts  1  2379.636 14140.06 14798.54

    Price  1   442.555 12202.98 12861.45

   Months  1   410.767 12171.19 12829.67

  Ceiling  1   335.846 12096.27 12754.75

Single term additions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              11760.42 12583.52

LogItems  1  181.7947 11578.63 12566.34

   Share  1   18.8867 11741.54 12729.25

Target03  1  299.6434 11460.78 12448.49

    Year  1  468.8725 11291.55 12279.27

 

Step:  AIC= 12279.27

 Deviation ~ Contracts + Price + Months + Ceiling + Year

 

Single term deletions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling + Year

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              11291.55 12279.27

Contracts  1  447.0910 11738.64 12561.74

    Price  1  384.1575 11675.71 12498.80

   Months  1  667.6910 11959.24 12782.34

  Ceiling  1  559.9557 11851.51 12674.60

     Year  1  468.8725 11760.42 12583.52

Single term additions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling + Year

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              11291.55 12279.27

LogItems  1  277.6383 11013.91 12166.25

   Share  1   66.1364 11225.41 12377.75

Target03  1  375.5824 10915.97 12068.30

 

Step:  AIC= 12068.3

 Deviation ~ Contracts + Price + Months + Ceiling + Year + Target03

 

Single term deletions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling + Year + Target03

 

scale:  82.30963

 

          Df Sum of Sq      RSS       Cp

   <none>              10915.97 12068.30

Contracts  1   476.987 11392.95 12380.67

    Price  1   423.724 11339.69 12327.41

   Months  1  1025.595 11941.56 12929.28

  Ceiling  1   558.767 11474.73 12462.45

     Year  1   544.811 11460.78 12448.49

 Target03  1   375.582 11291.55 12279.27

Single term additions

 

Model:

Deviation ~ Contracts + Price + Months + Ceiling + Year + Target03

 

scale:  82.30963

 

         Df Sum of Sq      RSS       Cp

  <none>              10915.97 12068.30

LogItems  1   110.798 10805.17 12122.12

   Share  1    89.471 10826.50 12143.45

> summary(final.model,cor=F)

 

Call: lm(formula = Deviation ~ Contracts + Price + Months + Ceiling + Year + Target03)

Residuals:

    Min    1Q  Median    3Q   Max

 -21.27 -4.46 -0.4779 3.672 31.46

 

Coefficients:

                 Value Std. Error    t value   Pr(>|t|)

(Intercept) -1634.3454   557.0874    -2.9337     0.0038

  Contracts    -0.3138     0.1151    -2.7255     0.0071

      Price    -2.0007     0.7789    -2.5688     0.0111

     Months     0.1630     0.0408     3.9965     0.0001

    Ceiling     0.4106     0.1392     2.9499     0.0036

       Year     0.8193     0.2813     2.9128     0.0041

   Target03    -1.8083     0.7477    -2.4185     0.0166

 

Residual standard error: 8.013 on 170 degrees of freedom

Multiple R-Squared: 0.2465

F-statistic: 9.268 on 6 and 170 degrees of freedom, the p-value is 8.725e-009