Created
July 24, 2016 16:07
-
-
Save nozma/845a4e793b7dadf6302296a2441a4033 to your computer and use it in GitHub Desktop.
カテゴリカルデータ解析第2章練習問題解答
This file contains 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. | |
# (a) | |
CtableS <- xtabs(~ Sex, data = Arthritis) | |
barplot(CtableS) | |
pie(CtableS, clockwise = TRUE) | |
# (b) | |
mosaicplot(~ Sex + Improved, data = Arthritis, col = TRUE) | |
# 3. | |
xtabs(Freq ~ management + own, data = JobSatisfaction) | |
# 4. | |
# (a) | |
xtabs(Freq ~ Age + Survived, data = Titanic) | |
# (b) | |
xtabs(Freq ~ Sex + Survived, data = Titanic[,,"Child",]) | |
# (c) | |
tmp <- xtabs(Freq ~ Class + Survived, data = Titanic) | |
tmp[-4,] | |
# 5. | |
data.frame(Titanic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment