2015년 12월 7일 월요일

[R] xtab, chisq test, fisher test

# 분할표, 카이제곱 검정, 피셔의 정확성 검정(샘플수 적을때)
xtabs(~ Sex + Exer , data=survey)
chisq.test(xtabs(~ Sex + Exer , data=survey))
chisq.test(xtabs(~ W.Hnd + Clap, data=survey))
fisher.test(xtabs(~ W.Hnd + Clap, data=survey))

# 맥니마 검정(동질집단 간 변화)
mcnemar.test(survey$Fold, survey$Clap)