简体   繁体   English

不平衡单向ANOVA的功率分析

[英]Power analysis for unbalanced one-way ANOVA

I'm trying to calculate a power analysis (using pwr package in R ) for an unbalanced one-way ANOVA . 我正在尝试计算功率分析(使用R pwr包)进行不平衡单向ANOVA I'm unsure how to appropriately weight the means or account for the unbalanced design. 我不确定如何适当地加权手段或解释不平衡的设计。 I currently have: 我目前有:

groups = 4

n = n for each group (here, n1=12 for group 1, n2=8 for group 2, n3=9, for group 3, and n4=12) 每组n = n (此处,组1的n1 = 12,组2的n2 = 8,组3的n3 = 9,n4 = 12)

between.var and within.var are known from the ANOVA analysis: 从方差分析中可以知道within.varwithin.var between.var within.var

(between.var=0.004363, within.var=0.003680)

And finally 最后

means = (0.1513, 0.1767, 0.1676, 0.1968). 平均值=(0.1513,0.1767,0.1676,0.1698)。

Any help would be appreciated. 任何帮助,将不胜感激。

Working with weighted means is described here: https://www.r-bloggers.com/r-tutorial-series-two-way-anova-with-unequal-sample-sizes/ 此处描述了使用加权平均值: 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

The data looks as the following: 数据如下所示:

示例中的数据

The code for the weighted means: 加权的代码意味着:

#use anova(object) to execute the Type I SS ANOVAs #use anova(object)执行Type I SS ANOVA

#environment ANOVA

anova(lm(math ~ environment * instruction, dataTwoWayUnequalSample))

#instruction ANOVA

anova(lm(math ~ instruction * environment, dataTwoWayUnequalSample))

代码的输出,取自网页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM