5

I'm trying to calculate a power analysis (using pwr package in R) for an unbalanced one-way 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)

between.var and within.var are known from the ANOVA analysis:

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

And finally

means = (0.1513, 0.1767, 0.1676, 0.1968).

Any help would be appreciated.

Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82
cc26
  • 59
  • 3
  • I'm voting to close this question as off-topic because it is about statistics, not programming, and is therefore off-topic. – divibisan Jan 18 '19 at 15:30

1 Answers1

0

Working with weighted means is described here: 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 data in the example

The code for the weighted means:

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

#environment ANOVA

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

#instruction ANOVA

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

The output of the code, taken from the web-page

OTStats
  • 1,820
  • 1
  • 13
  • 22
Sokolokki
  • 833
  • 1
  • 9
  • 19
  • A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – Zoe Jan 18 '19 at 13:54