Code in sas crd design with two sample t test

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 to detect a group mean difference in a two-sample test. You will use (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:

You conjecture two scenarios for the common group standard deviation:

You also want to try three weighting schemes:

  1. equal group sizes (balanced, or 1:1)
  2. twice as many patients with the new treatment (1:2)
  3. three times as many patients with the new treatment (1:3)

This makes 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 by using the GROUPMEANS= option. Using the "matched" notation (discussed in the section Specifying Value Lists in Analysis Statements), 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 by using the GROUPWEIGHTS= option. You could again use the matched notation. But for illustrative purposes, specify the scenarios for each group weight separately by 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 two-sided 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 67.4.