(→개요) |
(→개요) |
||
23번째 줄: | 23번째 줄: | ||
<source lang='r' notebook> | <source lang='r' notebook> | ||
predict(house.plr, housing, type = "p") | predict(house.plr, housing, type = "p") | ||
</source> | |||
<source lang='r' notebook> | |||
addterm(house.plr, ~.^2, test = "Chisq") | addterm(house.plr, ~.^2, test = "Chisq") | ||
house.plr2 <- stepAIC(house.plr, ~.^2) | house.plr2 <- stepAIC(house.plr, ~.^2) | ||
34번째 줄: | 36번째 줄: | ||
pr <- profile(house.plr) | pr <- profile(house.plr) | ||
confint(pr) | confint(pr) | ||
</source> | |||
<source lang='r' notebook> | |||
plot(pr) | plot(pr) | ||
</source> | |||
<source lang='r' notebook> | |||
pairs(pr) | pairs(pr) | ||
</source> | </source> |
2021년 5월 7일 (금) 19:27 판
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")
house.plr2 <- stepAIC(house.plr, ~.^2)
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
로그인하시면 댓글을 쓸 수 있습니다.