R step()

1 개요[ | ]

R step()
utils::example("lm", echo=F)
step(lm.D9)
## Start:  AIC=-12.58
## weight ~ group
## 
##         Df Sum of Sq    RSS     AIC
## - group  1    0.6882 9.4175 -13.063
## <none>               8.7292 -12.581
## 
## Step:  AIC=-13.06
## weight ~ 1
## 
## 
## Call:
## lm(formula = weight ~ 1)
## 
## Coefficients:
## (Intercept)  
##       4.847
library(MASS)
data(hills)
step(lm(time ~1, hills), scope=list(lower=~1,upper=~dist+climb), direction="forward")
## Start:  AIC=274.88
## time ~ 1
## 
##         Df Sum of Sq   RSS    AIC
## + dist   1     71997 13142 211.49
## + climb  1     55205 29934 240.30
## <none>               85138 274.88
## 
## Step:  AIC=211.49
## time ~ dist
## 
##         Df Sum of Sq     RSS    AIC
## + climb  1    6249.7  6891.9 190.90
## <none>               13141.6 211.49
## 
## Step:  AIC=190.9
## time ~ dist + climb
## 
## 
## Call:
## lm(formula = time ~ dist + climb, data = hills)
## 
## Coefficients:
## (Intercept)         dist        climb  
##    -8.99204      6.21796      0.01105

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}