[R] stepwise regression
ronggui
ronggui.huang at gmail.com
Fri Apr 28 03:54:51 CEST 2006
ÔÚ 06-4-28£¬Jinsong Zhao<jszhao at mail.hzau.edu.cn> дµÀ£º
> Dear all,
>
> I have encountered a problem when perform stepwise regression.
> The dataset have more 9 independent variables, but 7 observation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I think
this is the problem.
> In R, before performing stepwise, a lm object should be given.
> fm <- lm(y ~ X1 + X2 + X3 + X11 + X22 + X33 + X12 + X13 + X23)
>
> However, summary(fm) will give:
>
> Residual standard error: NaN on 0 degrees of freedom
> Multiple R-Squared: 1, Adjusted R-squared: NaN
> F-statistic: NaN on 6 and 0 DF, p-value: NA
>
> In this situation, step() or stepAIC() will not give any useful information.
>
> I don't know why SAS could deal with this situation:
> PROC REG;
> MODEL y=X1 X2 X3 X11 X22 X33 X12 X13 X23/SELECTION=STEPWISE;
> RUN;
>
> Any help will be really appreciated.
>
> Wishes,
>
> Jinsong Zhao
>
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
--
»ÆÈÙ¹ó
Deparment of Sociology
Fudan University
More information about the R-help
mailing list