*disclaimer
602958
emmeans
https://cran.r-project.org/web/packages/emmeans/vignettes/comparisons.html
- GLMでモデルを作って、そのモデルにおける要因の水準間の多重比較を行う。
- 例:1,2,3の学年間で、IPSynのスコアに差があるか?
モデル
ipsyn.model0 <- glm(ipsyn ~ year, data, family=gaussian)
平均と信頼区間
hikaku0 <- emmeans(ipsyn.model0, specs="year") year emmean SE df lower.CL upper.CL 1 54.8 1.022 131 52.7 56.8 2 64.3 0.958 131 62.5 66.2 3 69.5 1.034 131 67.4 71.5
多重比較検定
pairs(hikaku0, adjust="bonferroni") contrast estimate SE df t.ratio p.value 1 - 2 -9.58 1.40 131 -6.840 <.0001 1 - 3 -14.68 1.45 131 -10.099 <.0001 2 - 3 -5.11 1.41 131 -3.622 0.0012
プロット
plot(hikaku0, comparison=T)
- 別のプロット
plot(allEffects(ipsyn.model0))
https://sugiura-ken.org/wiki/