Applied Univariate, Bivariate, and Multivariate Statistics. Daniel J. Denis
Чтение книги онлайн.
Читать онлайн книгу Applied Univariate, Bivariate, and Multivariate Statistics - Daniel J. Denis страница 44
2.22 POWER ESTIMATION USING R AND G*POWER
To demonstrate the estimation of power using software, we first use pwr.r.test
(Champely, 2014) in R to estimate required sample size for a Pearson r correlation coefficient. As an example, we estimate required sample size for a population correlation coefficient of ρ = 0.10 at a significance level set to 0.05, with desired power equal to 0.90. Note that in the code that follows, we purposely leave n empty so R can estimate this figure for us:
> install.packages(“pwr”) > library(pwr) > pwr.r.test(n =, r = .10, sig.level = .05, power = .90) approximate correlation power calculation (arctangh transformation) n = 1046.423 r = 0.1 sig.level = 0.05 power = 0.9 alternative = two.sided
Figure 2.12 Power curves for detecting parameters C1 and C2.
Source: Bollen (1989). Reproduced with permission from John Wiley & Sons, Inc.
We see that to detect a correlation coefficient of 0.10 at a desired level of power equal to 0.9, a sample size of 1046 is required. We could round up to 1047 for a slightly more conservative estimate. It is a more conservative estimate because 1047 is slightly more “generous” of a sample than R is reporting is necessary (1046). Now, in this case, the difference is extremely slight, but in general, when you provide your analysis with more subjects than what may be necessary for a given level of power, you are guarding against the possibility of obtaining smaller effects than what you believe are “out there” in your population. If in doubt, larger samples are always preferable to smaller ones, and thus rounding “up” on sample size requirements is usually a good idea.
Estimating in G*Power,10 we obtain that given in Figure 2.13.
Note that our power estimate using G*Power is identical to that using R (i.e., power of 0.90 requires a sample size of 1046 for an effect size of ρ = 0.10). G*Power also allows us to draw the corresponding power curve. A power curve is a simple depiction of required sample size as a function of power and estimated effect size. What is nice about power curves is that they allow one to see how estimated sample size requirements and power increase or decrease as a function of effect size. For the estimation of estimated sample size for detecting ρ = 0.10, G*Power generates the curve in Figure 2.14 (top curve).
Figure 2.13 G*Power output for estimating required sample size for r = 0.10.
Figure 2.14 Power curves generated by G*Power for detecting correlation coefficients of ρ = 0.10 to 0.50.
Especially for small hypothesized values of ρ, the required sample size for even poor to modest levels of statistical power is quite large. For example, reading off the plot in Figure 2.14, to detect ρ = 0.10, at even a relatively low power level of 0.60, one requires upward of almost 500 participants. This might explain why many studies that yield relatively small effect sizes never get published. They often have insufficient power to reject their null hypotheses. As effect size increases, required sample size drops substantially. For example, to attain a modest level of power such as 0.68 for a correlation coefficient of 0.5, one requires only 21.5 participants, as can be more clearly observed from Table 2.6 which corresponds to the power curves in Figure 2.14 for power ranging from 0.60 to 0.69.
Hence, one general observation from this simple power analysis for detecting ρ is that size of effect (in this case, ρ) plays a very important role in determining estimated sample size. As a general rule, across virtually all statistical tests, if the effect you are studying is large, a much smaller sample size is required than if the effect is weak. Drawing on our analogy of the billboard sign that reads “H0 is false,” all else equal, if the sign is in large print (i.e., strong effect), you require less “power” in your prescription glasses to detect such a large sign. If the sign is in small print (i.e., weak effect), you require much more “power” in your lenses to detect it.
2.22.1 Estimating Sample Size and Power for Independent Samples t‐Test
For an independent‐samples t‐test, required sample size can be estimated through R using pwr.t.test
:
> pwr.t.test (n =, d =, sig.level =, power =, type = c(“two.sample”, “one.sample”, “paired”))
where, n
= sample size per group, d
= estimate of standardized statistical distance between means (Cohen's d), sig.level
= desired significance level of the test, power
= desired power level, and type
= designation of the kind of t‐test you are performing (for our example, we are performing a two‐sample test).
Table 2.6 Power Estimates as a Function of Sample Size and Estimated Magnitude Under Alternative Hypothesis
Exact – Correlation: Bivariate Normal Model Tail(s) = Two, Correlation ρ H0 = 0, α err prob = 0.05 | ||||||
---|---|---|---|---|---|---|
Correlation ρ H1 = 0.1 | Correlation ρ H1 = 0.2 | Correlation p HI = 0.3 | Correlation ρ HI = 0.4 | Correlation ρ HI = 0.5 | ||
# | Power(1‐β err prob) | Total Sample Size | Total Sample Size | Total Sample Size | Total Sample Size | Total Sample Size |
1 | 0.600000 | 488.500 | 121.500 | 53.5000 | 29.5000 |
|