2월 24일자 출석부에만 나오는 사람들의 분포
15 |
Red |
0224 |
NA |
19 |
Black |
0224 |
NA |
20 |
Red |
0224 |
NA |
58 |
Red |
0224 |
NA |
새로 들어온 사람에게만 랜덤화 적용
학번
class_roll %$%
table(.$group, .$id %>% substr(1, 4)) %>%
pander
Red |
2 |
1 |
2 |
0 |
0 |
2 |
33 |
Black |
0 |
0 |
0 |
1 |
2 |
3 |
34 |
class_roll %$%
substr(.$id, 1, 4) %>%
`>=`(2019) %>%
ifelse("younger_19", "older_19") %>%
factor(levels = c("younger_19", "older_19")) %>%
table(class_roll$group, .) %>%
pander
학번 홀짝
class_roll$id %>%
as.numeric %>%
`%%`(2) %>%
factor(levels = c(1, 0), labels = c("홀", "짝")) %>%
table(class_roll$group, .) %>%
pander
e-mail 서비스업체
class_roll$email %>%
strsplit("@", fixed = TRUE) %>%
sapply("[", 2) %>%
table(class_roll$group, .) %>%
pander
Red |
2 |
3 |
1 |
1 |
33 |
Black |
0 |
1 |
0 |
1 |
38 |
전화번호의 분포
cell_numbers <- class_roll$cell_no %>%
substr(start = 10, stop = 13) %>%
sapply(as.numeric)
cut_label <- paste(paste0(0:9, "000"), paste0(0:9, "999"),
sep = "~")
cell_numbers %>%
cut(labels = cut_label,
breaks = seq(0, 10000, by = 1000)) %>%
table(class_roll$group, .) %>%
# t %>%
pander
Red |
4 |
2 |
2 |
2 |
5 |
7 |
5 |
5 |
3 |
5 |
Black |
1 |
4 |
4 |
3 |
5 |
6 |
10 |
2 |
4 |
1 |
cell_numbers %>%
hist(main = "Histogram of Cell Phine Numbers")

cell_numbers %>%
cut(labels = cut_label,
breaks = seq(0, 10000, by = 1000)) %>%
table %>%
chisq.test
##
## Chi-squared test for given probabilities
##
## data: .
## X-squared = 13.75, df = 9, p-value = 0.1315
성씨 분포
f_name <- class_roll$name %>%
substring(first = 1, last = 1)
f_name %>%
table(class_roll$group, .) %>%
pander
Red |
0 |
0 |
14 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
3 |
2 |
1 |
0 |
4 |
2 |
1 |
0 |
4 |
0 |
1 |
2 |
0 |
0 |
1 |
1 |
Black |
3 |
1 |
11 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
5 |
0 |
0 |
2 |
1 |
3 |
0 |
1 |
3 |
1 |
0 |
2 |
1 |
1 |
0 |
1 |
많이 나오는 성씨
f_name %>%
`%in%`(c("김", "이", "박")) %>%
ifelse(f_name, "기타") %>%
factor(levels = c("김", "이", "박", "기타")) %>%
table(class_roll$group, .) %>%
pander
Red |
14 |
3 |
1 |
22 |
Black |
11 |
5 |
1 |
23 |
학과
# pander(class_roll)
class_roll %$%
table(.$group, .$dept) %>%
pander
Red |
29 |
2 |
3 |
1 |
1 |
0 |
0 |
1 |
0 |
2 |
1 |
Black |
31 |
0 |
1 |
0 |
4 |
1 |
1 |
0 |
1 |
1 |
0 |