我尝试计算功率分析(使用R
中的ANOVA
包)来计算不平衡的单向groups = 4
。我不确定如何适当地加权手段或说明不平衡的设计。我目前有:
n = n
每组 between.var
(此处,组1的n1 = 12,组2的n2 = 8,组3的n3 = 9,n4 = 12)
within.var
和(between.var=0.004363, within.var=0.003680)
:
{{1}}
最后
表示=(0.1513,0.1767,0.1676,0.1698)。
任何帮助将不胜感激。
答案 0 :(得分:0)
在这里描述使用加权均值的方法: https://www.r-bloggers.com/r-tutorial-series-two-way-anova-with-unequal-sample-sizes/
#read the dataset into an R variable using the read.csv(file) function
dataTwoWayUnequalSample <- read.csv(“dataset_ANOVA_TwoWayUnequalSample.csv”)
#display the data
dataTwoWayUnequalSample
#use anova(object)执行I型SS方差分析
#environment ANOVA
anova(lm(math ~ environment * instruction, dataTwoWayUnequalSample))
#instruction ANOVA
anova(lm(math ~ instruction * environment, dataTwoWayUnequalSample))