Displaying 1 result from an estimated 1 matches for "mswithin".
2007 Nov 22
3
anova planned comparisons/contrasts
...nG2 * ((G2Mean - GrandMean)^2)
else {
nG3 = sum(Group %in% G3)
G3Mean = mean(Var[Group %in% G3])
MScontr = (nG1 * ((G1Mean - GrandMean)^2) +
nG2 * ((G2Mean - GrandMean)^2) +
nG3 * ((G3Mean - GrandMean)^2))/2
}
An <- anova(lm(Var ~ Group))
MSwithin = An[3]['Residuals',]
DegF = An$Df[length(An$Df)]
Fval = MScontr / MSwithin
Pval = 1 - pf(Fval, 1, DegF)
return (list(MS_contrasts = MScontr, MS_within = MSwithin,
F_value = Fval, P_value = Pval))
}
## The first two contrasts produce the same (+/- rounding error)
## p...