ANNOVA CONTRASTS
But we may not interest in every group, t-test for individual contrasts are as followed.
Confidence Intervals
Multiple comparisons: simultaneous confidence intervals
se = sqrt(sig_sq_hat * ((1/n_i[1]) + (1/n_i[2])))
int.95.indiv = ybar_i[1] - ybar_i[2] + c(-1,1) * t_star * se
画图上面那组看overlap,下面那组看0是否在范围内。
However, we have constructed each interval without taking any regard of the others.
I.Relaxing the equal variance assumption
II Relaxing the normality assumption
A weaker set of assumptions at least under the null hypothesis is that: All observations come from the same distribution
permutation test
check nomality发现不nomal
library(ggfortify)
autoplot(rugby_anova, which = 2)
B = 2000
f_stat = vector(mode = "numeric", length = B)
for (i in 1:B){
permuted_anova = aov(sample(rugby$Time) ~ factor(rugby$Game))
f_stat[i] = broom::tidy(permuted_anova)$statistic[1]
}
rugby_anova = aov(Time ~ factor(Game), data = rugby)
t0 = anova(rugby_anova)[1,4]
mean(f_stat >= t_0)
kruskal.test()