In a prospective power analysis you investigate the power for detecting
specified group differences given one or more settings of the:
- overall sample size,
- estimate of variance, and
- significance level.
You can do prospective power analyses with the %POWER macro. Beginning in SAS 9,
you can also use PROC GLMPOWER for prospective power analysis. Both are
illustrated below.
You first create a data set of proposed means and sample sizes. For example,
suppose you want to compare three groups. The table below displays the means you
expect the groups to have and the number of observations you can collect from
each.
Data for Prospective Power Analysis
Group Mean Count
1 40 5
2 45 10
3 35 10
Create a data set containing this information as follows:
data prospect;
input group mean count;
cards;
1 40 5
2 45 10
3 35 10
;
To get the OUTSTAT= data set required by the %POWER macro, submit
the following statements:
proc glm data=prospect outstat=prosout;
class group;
freq count;
model mean=group;
run;
Below are the results from PROC GLM:
The GLM Procedure
Dependent Variable: mean
Frequency: count
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 2 500.0000000 250.0000000 Infty <.0001
Error 22 0.0000000 0.0000000
Corrected Total 24 500.0000000
R-Square Coeff Var Root MSE mean Mean
1.000000 0 0 40.00000
Source DF Type I SS Mean Square F Value Pr > F
group 2 500.0000000 250.0000000 Infty <.0001
Source DF Type III SS Mean Square F Value Pr > F
group 2 500.0000000 250.0000000 Infty <.0001
Note that the Error Sum of Squares and the
Mean Square Error are zero since the data input to PROC GLM contain no
variation within the groups. Suppose in planning this study that you expect
the standard deviation (sigma) to be in the range of 4 to 8. For the
above sample sizes and means, the effect size (delta) is sqrt(SS(Group)/N)
= sqrt(500/25) = 4.47. If the means were 35, 40, 40 with the same sample
sizes, delta would be sqrt(150/25) = 2.45. You decide to look at two delta
values, 2 and 5, which cover this range. In addition, you may want to
see how much the significance level of the test affects the power. You
select 0.01 and 0.05 as possible alpha levels.
You can now enter the above information into the %POWER macro and obtain
the power and least significant number for each combination of alpha,
sigma, and delta. Note that the delta value from the original sample
size and means scenario (4.47) is used in addition to the specified
delta values 2 and 5 resulting in 12 combinations. Because population
values are used to compute an unbiased noncentrality parameter in a
prospective power analysis, the adjusted power and confidence limits are
not requested.
%power(data=prosout,
out=powout,
effect=group,
calcs=power lsn,
alpha=.01 .05,
sigma=4.0 8.0,
delta=2.0 5.0)
Below are the results from the %POWER macro:
Power Calculation for effect GROUP
Type 3 Sums of Squares
Type I Root Mean Least Power
Error Sample Square Effect Power of Significant when
Rate Size Error Size Test Number N=LSN
0.01 25 4 4.4721 0.98180 13 0.61352
0.01 25 4 2.0000 0.27786 42 0.57327
0.01 25 4 5.0000 0.99618 12 0.66168
0.01 25 8 4.4721 0.36851 35 0.58151
0.01 25 8 2.0000 0.05112 153 0.57058
0.01 25 8 5.0000 0.47960 29 0.58188
0.05 25 4 4.4721 0.99808 9 0.63152
0.05 25 4 2.0000 0.54066 28 0.59915
0.05 25 4 5.0000 0.99976 8 0.62879
0.05 25 8 4.4721 0.64218 23 0.59718
0.05 25 8 2.0000 0.16588 99 0.58380
0.05 25 8 5.0000 0.74515 19 0.59421
In the first scenario (alpha=.01, sigma=4, delta=4.47), the power for
detecting group differences is .98. In fact, with a total sample size as
low as 13 (the LSN), you would have power=.61 for detecting group
differences. If you selected equal group sample sizes of 5, for a total
sample size of 15, you would get a slightly higher power.
You can see from the table that power is high when sigma is small and
the effect size is large. Power is related to the effect size
(separation of means), standard deviation (sigma), significance
level (alpha), and sample size. In general, there are four ways to
increase power: increase effect size, decrease residual variance,
increase sample size, or increase alpha.
The prospective power analysis using the proposed means can also be done using
PROC GLMPOWER as follows:
proc glmpower;
class group;
model mean=group;
power alpha=.01 .05
stddev=4 8
ntotal=25
power=.;
weight count;
run;
Following are the results from PROC GLMPOWER. Note that the power values
match those from the POWER macro for the proposed means.
The GLMPOWER Procedure
Fixed Scenario Elements
Dependent Variable mean
Source group
Weight Variable count
Total Sample Size 25
Test Degrees of Freedom 2
Error Degrees of Freedom 22
Computed Power
Std
Index Alpha Dev Power
1 0.01 4 0.982
2 0.01 8 0.369
3 0.05 4 0.998
4 0.05 8 0.642