TWOSAMPLEMEANS <options>;
The TWOSAMPLEMEANS statement performs power and sample size analyses for pooled and unpooled t tests, equivalence tests, and confidence interval precision involving two independent samples.
Table 26 summarizes the options available in the TWOSAMPLEMEANS statement.
Table 26: TWOSAMPLEMEANS Statement Options
| Option | Description |
|---|---|
| Define Analysis | |
| CI= | Specifies an analysis of precision of the confidence interval |
| DIST= | Specifies the underlying distribution assumed for the test statistic |
| TEST= | Specifies the statistical analysis |
| Specify Analysis Information | |
| ALPHA= | Specifies the significance level |
| LOWER= | Specifies the lower equivalence bound |
| NULLDIFF= | Specifies the null mean difference |
| NULLRATIO= | Specifies the null mean ratio |
| SIDES= | Specifies the number of sides and the direction of the statistical test or confidence interval |
| UPPER= | Specifies the upper equivalence bound |
| Specify Effects | |
| HALFWIDTH= | Specifies the desired confidence interval half-width |
| GROUPMEANS= | Specifies the two group means |
| MEANDIFF= | Specifies the mean difference |
| MEANRATIO= | Specifies the geometric mean ratio, |
| Specify Variability | |
| CV= | Specifies the common coefficient of variation |
| GROUPSTDDEVS= | Specifies the standard deviation of each group |
| STDDEV= | Specifies the common standard deviation |
| Specify Sample Size and Allocation | |
| GROUPNS= | Specifies the two group sample sizes |
| GROUPWEIGHTS= | Specifies the sample size allocation weights for the two groups |
| NFRACTIONAL | Enables fractional input and output for sample sizes |
| NPERGROUP= | Specifies the common sample size per group |
| NTOTAL= | Specifies the sample size |
| Specify Power and Related Probabilities | |
| POWER= | Specifies the desired power of the test |
| PROBTYPE= | Specifies the type of probability for the PROBWIDTH= option |
| PROBWIDTH= | Specifies the desired probability of obtaining a confidence interval half-width less than or equal to the value specified |
| Control Ordering in Output | |
| OUTPUTORDER= | Controls the output order of parameters |
Table 27 summarizes the valid result parameters for different analyses in the TWOSAMPLEMEANS statement.
Table 27: Summary of Result Parameters in the TWOSAMPLEMEANS Statement
| Analyses | Solve For | Syntax |
|---|---|---|
| TEST=DIFF | Power | POWER=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. | ||
| Group sample size | GROUPNS= n1 | . | |
| GROUPNS=. | n2 | ||
| GROUPNS= (n1 .) | ||
| GROUPNS= (. n2) | ||
| Group weight | GROUPWEIGHTS= w1 | . | |
| GROUPWEIGHTS=. | w2 | ||
| GROUPWEIGHTS= (w1 .) | ||
| GROUPWEIGHTS= (. w2) | ||
| Alpha | ALPHA=. | |
| Group mean | GROUPMEANS= mean1 | . | |
| GROUPMEANS=. | mean2 | ||
| GROUPMEANS= (mean1 .) | ||
| GROUPMEANS= (. mean2) | ||
| Mean difference | MEANDIFF=. | |
| Standard deviation | STDDEV=. | |
| TEST=DIFF_SATT | Power | POWER=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. | ||
| TEST=RATIO | Power | POWER=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. | ||
| TEST=EQUIV_DIFF | Power | POWER=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. | ||
| TEST=EQUIV_RATIO | Power | POWER=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. | ||
| CI=DIFF | Prob(width) | PROBWIDTH=. |
| Sample size | NTOTAL=. | |
| NPERGROUP=. |
To define the analysis, choose one of the following parameterizations:
To specify the means, choose one of the following parameterizations:
individual group means (by using the GROUPMEANS= option)
mean difference (by using the MEANDIFF= option)
mean ratio (by using the MEANRATIO= option)
To specify standard deviations in the Satterthwaite t test (TEST=DIFF_SATT), choose one of the following parameterizations:
common standard deviation (by using the STDDEV= option)
individual group standard deviations (by using the GROUPSTDDEVS== option)
To specify the sample sizes and allocation, choose one of the following parameterizations:
sample size per group in a balanced design (by using the NPERGROUP= option)
total sample size and allocation weights (by using the NTOTAL= and GROUPWEIGHTS= options)
individual group sample sizes (by using the GROUPNS= option)
This section summarizes the syntax for the common analyses that are supported in the TWOSAMPLEMEANS statement.
You can use the NPERGROUP= option in a balanced design and express effects in terms of the mean difference, as in the following statements. Default values for the DIST=, SIDES=, NULLDIFF=, and ALPHA= options specify a two-sided test for no difference with a normal distribution and a significance level of 0.05.
proc power;
twosamplemeans test=diff
meandiff = 7
stddev = 12
npergroup = 50
power = .;
run;
You can also specify an unbalanced design by using the NTOTAL= and GROUPWEIGHTS= options and express effects in terms of individual group means:
proc power;
twosamplemeans test=diff
groupmeans = 8 | 15
stddev = 4
groupweights = (2 3)
ntotal = .
power = 0.9;
run;
Another way to specify the sample sizes is with the GROUPNS= option:
proc power;
twosamplemeans test=diff
groupmeans = 8 | 15
stddev = 4
groupns = (25 40)
power = .;
run;
The following statements demonstrate a power computation for the two-sample Satterthwaite t test allowing unequal variances. Default values for the DIST=, SIDES=, NULLDIFF=, and ALPHA= options specify a two-sided test for no difference with a normal distribution and a significance level of 0.05.
proc power;
twosamplemeans test=diff_satt
meandiff = 3
groupstddevs = 5 | 8
groupweights = (1 2)
ntotal = 60
power = .;
run;
The following statements demonstrate a power computation for the pooled t test of a lognormal mean ratio. Default values for the DIST=, SIDES=, NULLRATIO=, and ALPHA= options specify a two-sided test of mean ratio = 1 assuming a lognormal distribution and a significance level of 0.05.
proc power;
twosamplemeans test=ratio
meanratio = 7
cv = 0.8
groupns = 50 | 70
power = .;
run;
The following statements demonstrate a sample size computation for the TOST equivalence test for a normal mean difference. A default value of GROUPWEIGHTS=(1 1) specifies a balanced design. Default values for the DIST= and ALPHA= options specify a significance level of 0.05 and an assumption of normally distributed data.
proc power;
twosamplemeans test=equiv_diff
lower = 2
upper = 5
meandiff = 4
stddev = 8
ntotal = .
power = 0.9;
run;
The following statements demonstrate a power computation for the TOST equivalence test for a lognormal mean ratio. Default values for the DIST= and ALPHA= options specify a significance level of 0.05 and an assumption of lognormally distributed data.
proc power;
twosamplemeans test=equiv_ratio
lower = 3
upper = 7
meanratio = 5
cv = 0.75
npergroup = 50
power = .;
run;
By default CI=DIFF analyzes the conditional probability of obtaining the desired precision, given that the interval contains the true mean difference, as in the following statements. The defaults of SIDES=2 and ALPHA=0.05 specify a two-sided interval with a confidence level of 0.95.
proc power;
twosamplemeans ci = diff
halfwidth = 4
stddev = 8
groupns = (30 35)
probwidth = .;
run;