(새 문서: ==개요== ;R polr * "Ordered Logistic Or Probit Regression" ==참고== * https://www.rdocumentation.org/packages/MASS/versions/7.3-51.5/topics/polr 분류: R MASS) |
Jmnote bot (토론 | 기여) 잔글 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight , -</source> +</syntaxhighlight>)) |
||
(다른 사용자 한 명의 중간 판 9개는 보이지 않습니다) | |||
1번째 줄: | 1번째 줄: | ||
==개요== | ==개요== | ||
;R polr | ;R polr() | ||
* "Ordered Logistic Or Probit Regression" | * "Ordered Logistic Or Probit Regression" | ||
<syntaxhighlight lang='r' notebook> | |||
library(MASS) | |||
options(contrasts = c("contr.treatment", "contr.poly")) | |||
house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing) | |||
house.plr | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
summary(house.plr, digits = 3) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
summary(update(house.plr, method = "probit", Hess = TRUE), digits = 3) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
summary(update(house.plr, method = "loglog", Hess = TRUE), digits = 3) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
summary(update(house.plr, method = "cloglog", Hess = TRUE), digits = 3) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
predict(house.plr, housing, type = "p") | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
addterm(house.plr, ~.^2, test = "Chisq") | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
house.plr2 <- stepAIC(house.plr, ~.^2) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
house.plr2$anova | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
anova(house.plr, house.plr2) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
house.plr <- update(house.plr, Hess=TRUE) | |||
pr <- profile(house.plr) | |||
confint(pr) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
plot(pr) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='r' notebook> | |||
pairs(pr) | |||
</syntaxhighlight> | |||
==같이 보기== | |||
* [[R glm()]] | |||
* [[R optim()]] | |||
* [[R multinom()]] | |||
==참고== | ==참고== |
2021년 5월 7일 (금) 19:30 기준 최신판
1 개요[ | ]
- R polr()
- "Ordered Logistic Or Probit Regression"
R
Reload
Copy
library(MASS)
options(contrasts = c("contr.treatment", "contr.poly"))
house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
house.plr
Loading
Copy
summary(house.plr, digits = 3)
Loading
Copy
summary(update(house.plr, method = "probit", Hess = TRUE), digits = 3)
Loading
Copy
summary(update(house.plr, method = "loglog", Hess = TRUE), digits = 3)
Loading
Copy
summary(update(house.plr, method = "cloglog", Hess = TRUE), digits = 3)
Loading
Copy
predict(house.plr, housing, type = "p")
Loading
Copy
addterm(house.plr, ~.^2, test = "Chisq")
Loading
Copy
house.plr2 <- stepAIC(house.plr, ~.^2)
Loading
Copy
house.plr2$anova
Loading
Copy
anova(house.plr, house.plr2)
Loading
Copy
house.plr <- update(house.plr, Hess=TRUE)
pr <- profile(house.plr)
confint(pr)
Loading
Copy
plot(pr)
Loading
Copy
pairs(pr)
Loading
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.