Suppose you want to improve the accuracy of a machine used to print logos on sports jerseys. The machine has an inherently high variability, but its horizontal alignment can be adjusted. The operator agrees to pay for a costly adjustment if you can establish a non-zero mean horizontal displacement in either direction with high confidence. You have 150 jerseys at your disposal to measure, and you want to determine your chances of a significant result (power) using a one-sample t test with a 2-sided ± = 0 . 05.
You decide that 8 mm is the smallest displacement worth addressing. Hence, you will assume a true mean of 8 in the power computation. Experience indicates that the standard deviation is about 40.
Use the ONESAMPLEMEANS statement in the POWER procedure to compute the power. Indicate power as the result parameter by specifying the POWER= option with a missing value (.). Specify your conjectures for the mean and standard deviation using the MEAN= and STDDEV= options and the sample size using the NTOTAL= option. The statements required to perform this analysis are as follows :
proc power; onesamplemeans mean = 8 ntotal = 150 stddev = 40 power = .; run;
Default values for the TEST=, DIST=, ALPHA=, NULL=, and SIDES= options specify a 2-sided t test for a mean of 0, assuming a normal distribution with a significance level of ± = 0.05.
The POWER Procedure One-sample t Test for Mean Fixed Scenario Elements Distribution Normal Method Exact Mean 8 Standard Deviation 40 Total Sample Size 150 Number of Sides 2 Null Mean 0 Alpha 0.05 Computed Power Power 0.682
The power is about 0.68. In other words, there is about a 2/3 chance that the t test will produce a significant result demonstrating the machine s average off-center displacement. This probability depends on the assumptions for the mean and standard deviation.
Now, suppose you want to account for some of your uncertainty in conjecturing the true mean and standard deviation by evaluating the power for four scenarios using reasonable low and high values, 5 and 10 for the mean, and 30 and 50 for the standard deviation. Also, you may be able to measure more than 150 jerseys, and you would like to know under what circumstances you could get by with fewer. You want to plot power for sample sizes between 100 and 200 to visualize how sensitive the power is to changes in sample size for these four scenarios of means and standard deviations. The following statements perform this analysis:
proc power; onesamplemeans mean = 5 10 ntotal = 150 stddev = 30 50 power = .; plot x=n min=100 max=200; run;
The new mean and standard deviation values are specified using the MEAN= and STDDEV= options in the ONESAMPLEMEANS statement. The PLOT statement with X=N produces a plot with sample size on the x-axis. (The result parameter, in this case the power, is always plotted on the other axis.) The MIN= and MAX= options in the PLOT statement determine the sample size range.
Figure 57.2 shows the output, and Figure 57.3 shows the plot.
The POWER Procedure One-sample t Test for Mean Fixed Scenario Elements Distribution Normal Method Exact Total Sample Size 150 Number of Sides 2 Null Mean 0 Alpha 0.05 Computed Power Std Index Mean Dev Power 1 5 30 0.527 2 5 50 0.229 3 10 30 0.982 4 10 50 0.682
The power ranges from about 0.23 to 0.98 for a sample size of 150 depending on the mean and standard deviation. In Figure 57.3, the line style identifies the mean, and the plotting symbol identifies the standard deviation. The locations of plotting symbols indicate computed powers; the curves are linear interpolations of these points. The plot suggests sufficient power for a mean of 10 and standard deviation of 30 (for any of the sample sizes) but insufficient power for the other three scenarios.
In this example you want to compare two physical therapy treatments designed to increase muscle flexibility. You need to determine the number of patients required to achieve a power of at least 0 . 9 to detect a group mean difference in a two-sample t test. You will use ± = 0 . 05 (two-tailed).
The mean flexibility with the standard treatment (as measured on a scale of 1 to 20) is well known to be about 13 and is thought to be between 14 and 15 with the new treatment. You conjecture three alternative scenarios for the means,
µ 1 = 13 , µ 2 = 14
µ 1 = 13 , µ 2 = 14 . 5
µ 1 = 13 , µ 2 = 15
You conjecture two scenarios for the common group standard deviation:
ƒ = 1 . 2
ƒ = 1 . 7
You also want to try three weighting schemes:
equal group sizes (balanced, or 1:1)
twice as many patients with the new treatment (1:2)
three times as many patients with the new treatment (1:3)
This makes 3 — 2 — 3 = 18 scenarios in all.
Use the TWOSAMPLEMEANS statement in the POWER procedure to determine the sample sizes required to give 90% power for each of these 18 scenarios. Indicate total sample size as the result parameter by specifying the NTOTAL= option with a missing value (.). Specify your conjectures for the means using the GROUPMEANS= option. Using the matched notation (discussed in the Specifying Value Lists in Analysis Statements section on page 3490), enclose the two group means for each scenario in parentheses. Use the STDDEV= option to specify scenarios for the common standard deviation. Specify the weighting schemes using the GROUPWEIGHTS= option. You could again use the matched notation. But for illustrative purposes, specify the scenarios for each group weight separately using the crossed notation, with scenarios for each group weight separated by a vertical bar (). The statements that perform the analysis are as follows:
proc power; twosamplemeans groupmeans = (13 14) (13 14.5) (13 15) stddev = 1.2 1.7 groupweights = 1 1 2 3 power = 0.9 ntotal = .; run;
Default values for the TEST=, DIST=, NULLDIFF=, ALPHA=, and SIDES= options specify a 2-sided t test of group mean difference equal to 0, assuming a normal distribution with a significance level of ± = 0.05. The results are shown in Figure 57.4.
The POWER Procedure Two-sample t Test for Mean Difference Fixed Scenario Elements Distribution Normal Method Exact Group 1 Weight 1 Nominal Power 0.9 Number of Sides 2 Null Difference 0 Alpha 0.05 Computed N Total Std Actual N Index Mean1 Mean2 Dev Weight2 Power Total 1 13 14.0 1.2 1 0.907 64 2 13 14.0 1.2 2 0.908 72 3 13 14.0 1.2 3 0.905 84 4 13 14.0 1.7 1 0.901 124 5 13 14.0 1.7 2 0.905 141 6 13 14.0 1.7 3 0.900 164 7 13 14.5 1.2 1 0.910 30 8 13 14.5 1.2 2 0.906 33 9 13 14.5 1.2 3 0.916 40 10 13 14.5 1.7 1 0.900 56 11 13 14.5 1.7 2 0.901 63 12 13 14.5 1.7 3 0.908 76 13 13 15.0 1.2 1 0.913 18 14 13 15.0 1.2 2 0.927 21 15 13 15.0 1.2 3 0.922 24 16 13 15.0 1.7 1 0.914 34 17 13 15.0 1.7 2 0.921 39 18 13 15.0 1.7 3 0.910 44
The interpretation is that in the best-case scenario (large mean difference of 2, small standard deviation of 1.2, and balanced design), a sample size of N = 18( n 1 = n 2 = 9) patients is sufficient to achieve a power of at least 0.9. In the worst-case scenario (small mean difference of 1, large standard deviation of 1.7, and a 1:3 unbalanced design), a sample size of N = 164 ( n 1 = 41 , n 2 = 123) patients is necessary. The Nominal Power of 0.9 in the Fixed Scenario Elements table represents the input target power, and the Actual Power column in the Computed N Total table is the power at the sample size (N Total) adjusted to achieve the specified sample weighting exactly.
Note the following characteristics of the analysis, and ways you can modify them if you wish.
The total sample sizes are rounded up to multiples of the weight sums (2 for the 1:1 design, 3 for the 1:2 design, and 4 for the 1:3 design) to ensure that each group size is an integer. To request raw fractional sample size solutions, use the NFRACTIONAL option.
Only the group weight that varies (the one for group 2) is displayed as an output column, while the weight for group 1 appears in the Fixed Scenario Elements table. To display the group weights together in output columns , use the matched version of the value list rather than the crossed version.
If you can only specify differences between group means (instead of their individual values), or if you want to display the mean differences instead of the individual means, use the MEANDIFF= option instead of the GROUPMEANS= option.
The following statements implement all of these modifications.
proc power; twosamplemeans nfractional meandiff = 1 to 2 by 0.5 stddev = 1.2 1.7 groupweights = (1 1) (1 2) (1 3) power = 0.9 ntotal = .; run;
Figure 57.5 shows the new results.
The POWER Procedure Two-sample t Test for Mean Difference Fixed Scenario Elements Distribution Normal Method Exact Nominal Power 0.9 Number of Sides 2 Null Difference 0 Alpha 0.05 Computed Ceiling N Total Mean Std Fractional Actual Ceiling Index Diff Dev Weight1 Weight2 N Total Power N Total 1 1.0 1.2 1 1 62.507429 0.902 63 2 1.0 1.2 1 2 70.065711 0.904 71 3 1.0 1.2 1 3 82.665772 0.901 83 4 1.0 1.7 1 1 123.418482 0.901 124 5 1.0 1.7 1 2 138.598159 0.901 139 6 1.0 1.7 1 3 163.899094 0.900 164 7 1.5 1.2 1 1 28.961958 0.900 29 8 1.5 1.2 1 2 32.308867 0.906 33 9 1.5 1.2 1 3 37.893351 0.901 38 10 1.5 1.7 1 1 55.977156 0.900 56 11 1.5 1.7 1 2 62.717357 0.901 63 12 1.5 1.7 1 3 73.954291 0.900 74 13 2.0 1.2 1 1 17.298518 0.913 18 14 2.0 1.2 1 2 19.163836 0.913 20 15 2.0 1.2 1 3 22.282926 0.910 23 16 2.0 1.7 1 1 32.413512 0.905 33 17 2.0 1.7 1 2 36.195531 0.907 37 18 2.0 1.7 1 3 42.504535 0.903 43
Note that the Nominal Power of 0.9 applies to the raw computed sample size (Fractional N Total), and the Actual Power column applies to the rounded sample size (Ceiling N Total). Some of the adjusted sample sizes in Figure 57.5 are lower than those in Figure 57.4 because underlying group sample sizes are allowed to be fractional (for example, the first Ceiling N Total of 63 corresponding to equal group sizes of 31.5).