用step backward以及F test做题 输入指令以及结果如下: --------------------------------------------------------------------------- > step(full,direction = c(’backward’),test = ’F’,k= 10) Start: AIC=157.39 PE ~ AT + V + AP + RH Df Sum of Sq RSS AIC F value Pr(>F) - AP 1 0.00 586.17 147.39 0.0003 0.98685 - V 1 42.51 628.68 150.19 2.5385 0.12009 - RH 1 51.92 638.08 150.78 3.0999 0.08703 . <none> 586.16 157.39 - AT 1 897.71 1483.87 184.54 53.6026 1.477e-08*** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Step: AIC=147.39 PE ~ AT + V + RH Df Sum of Sq RSS AIC F value Pr(>F) - V 1 52.18 638.35 140.80 3.2046 0.08184 . - RH 1 65.48 651.65 141.62 4.0216 0.05248 . <none> 586.17 147.39 - AT 1 1371.42 1957.58 185.62 84.2269 5.844e-11*** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Step: AIC=140.8 PE ~ AT + RH Df Sum of Sq RSS AIC Fvalue Pr(>F) - RH 1 176.5 814.9 140.57 10.233 0.002827 ** <none> 638.3 140.80 - AT 1 7918.5 8556.8 234.62 458.974 <2.2e-16 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Step: AIC=140.57 PE ~ AT Df Sum of Sq RSS AIC Fvalue Pr(>F) <none> 814.9 140.57 - AT 1 12651 13465.8 242.76 589.94 <2.2e-16 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Call: lm(formula = PE ~ AT, data = Power) Coefficients: (Intercept) AT 496.786 -2.165 ------------------------------------------------------------------------------------- 目前有两个问题不清楚 1.怎么看在10% level下的最终模型?因为从第一部里,看到如果去除RH,就会得到p值小于0.1。但是我不确定是否是这样,还是要从第二部里看,当去除V时得到的模型? 2.如果想用sequential F test得出只有AT和RH的模型是否比整体模型好的时候,从哪个模型看它们的回归平方和(SSR)? 大神求教啊!!感谢!
|