l*********d 发帖数: 254 | 1 在选择regression model的时候,用到step() function :step forward, step
backward and step both.
在以上三种step() function 选择model的过程中,都用到了AIC value作为选择的标准
.因而在step() function中,是包含了计算AIC的equation的。另一方面,AIC()
function同样也是计算AIC值的,但是所得到的AIC与从step()function得到的AIC是不
同的。因为它们用了不同的equation 来计算AIC. 问题是,我要怎样才能在R中看到这
两个不同的equation呢?换句话说,我应该用什么样的code才能找到这两个equation呢
? 请各位高手指点!谢谢! | F****r 发帖数: 151 | 2 the help on AIC and extractAIC functions in R may be helpful | l*********d 发帖数: 254 | 3 Really thank you!
The help says:
The criterion used is
AIC = - 2*log L + k * edf,
where L is the likelihood and edf the equivalent degrees of freedom (i.e.,
the number of free parameters for usual parametric models) of fit.
For linear models with unknown scale (i.e., for lm and aov), -2log L is
computed from the deviance and uses a different additive constant to logLik
and hence AIC. If RSS denotes the (weighted) residual sum of squares then
extractAIC uses for - 2log L the formulae RSS/s - n (c
【在 F****r 的大作中提到】 : the help on AIC and extractAIC functions in R may be helpful
|
|