Angelica D. answered 4d
Clinical Psychology Ph.D. Student | Psychology and Statistics
Let's assume we're using R or RStudio.
We need to determine what power command we want to use, and what package it comes from so we can load it into our current R session. If we look at the R Documentation, we see that we can use pwr.t.test from the pwr package. If we've never installed this package before, let's do so, and load it.
Next, we see from the RDocumentation that the following parameters are needed:
n: number of observations (per sample)
d: effect size (Cohen's d) - difference between the means divided by the pooled standard deviation
sig.level: significance level (Type I error probability)
power: power of test (1 minus Type II error probability)
type: type of t test : one- two- or paired-samples
alternative: a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".
Importantly, we will label the parameter that we want to estimate as "NULL." Since your question specifically aims to estimate the "power" parameter, that will be labeled as "NULL" in our code. However, only 1 parameter can be estimated at a time. Given that you are looking to conduct an independent sample t-test (in other words, a two-sample t-test), we need the number of observations per group to accurately answer the question. Nonetheless, let's assume that the number of observations per group is 32, and there are 32 individuals in each group. In this case, our parameter inputs would look like:
number of observations (n) in each group = 32,
d (difference between groups (2) / SD (4)) = 0.5,
sig.level = 0.05,
power = NULL (this is what we are estimating),
type = "two.sample"
alternative = two.sided (let's stick with the default here).
If we put that all together in R, we would run the following command:
When we run that in RStudio, here's what we get:
Therefore, the power with the above parameters is ~0.50.