0
$\begingroup$

I have a question regarding power analysis in R using the following function:

library(pwr2)
pwr.2way(a=2, b=8, alpha=0.01, size.A=12, size.B=12, f.A=0.47, f.B=0.4)

whereas:

a=levels of first group
b=levels of second group
alpha=confidence interval
sizeA=sample size of group A
sizeB= sample size of groupB
f.A=effect size of A
f.B=effect size of B

I'm wondering if my sizeA and sizeB is correct and why there are two variables for it. I'm working with a two way anova in a full factorial design.

Isn't the sample size always the same for both group A and group B?

Are there cases where the sample size differs?

Like I said, I'm using a 2x8 full factorial design with a repetition of 12 per treatment. So did I use the right sample size in my code above?

$\endgroup$

2 Answers 2

1
$\begingroup$

There is no way for us to know if what you did is correct -- that depends on your situation. But there are certainly cases where the sample size varies two groups (or more than two groups). In observational studies, I'd say it's usually the case that the sample sizes vary.

$\endgroup$
0
$\begingroup$

In a full factorial design, you have all possible combinations of the levels of the factors. For your 2x8 design with 12 repetitions per treatment, you have:

Factor A: 2 levels Factor B: 8 levels Repetitions: 12 per treatment combination

Given your design, each combination of the levels of Factor A and Factor B will have 12 observations. Therefore, the total sample size for each factor level is:

Total for Factor A: 192 Total for Factor B: 192

However, in the pwr.2way function, size.A and size.B are specified per level of the factors. Since you have 12 repetitions per treatment combination, you correctly set size.A and size.B to 12.

There can be cases where the sample sizes for different factors differ, especially in unbalanced designs. In such cases, size.A and size.B would reflect the different sample sizes for each factor level.

So, if you wanted a 2x8 full factorial design with 12 repetitions per treatment, you have correctly specified the sample sizes in your code. Each level of Factor A and Factor B has 12 observations, which aligns with your design.

New contributor
George Box is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.