Last active
July 27, 2016 14:47
-
-
Save nozma/a6ce4ca4d01354d336c90454e1ae070d to your computer and use it in GitHub Desktop.
カテゴリカルデータ解析第6章練習問題解答
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 練習問題 | |
| # 1. | |
| Titan <- data.frame(Titanic) | |
| res <- glm(Survived ~ Class + Sex + Age, weights = Freq, | |
| family = binomial, data = Titan) | |
| res | |
| summary(res) | |
| exp(res$coefficients) | |
| mosaicplot(Titanic, color = TRUE) | |
| # 2. | |
| head(JointSports) | |
| ordered(JointSports$opinion, levels = c("very bad", "bad", "indifferent")) | |
| polr(opinion ~ year + grade + gender, weight = Freq, data = JointSports) | |
| mosaicplot(xtabs(Freq ~ year + grade + gender + opinion, data = JointSports), | |
| color = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment