The POWER Procedure
TWOSAMPLEMEANS Statement
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.
Summary of Options
Table 91.26 summarizes the options available in the TWOSAMPLEMEANS statement.
Table 91.26: TWOSAMPLEMEANS Statement Options
Option | Description |
|---|---|
Define Analysis | |
Specifies an analysis of precision of the confidence interval | |
Specifies the underlying distribution assumed for the test statistic | |
Specifies the statistical analysis | |
Specify Analysis Information | |
Specifies the significance level | |
Specifies the lower equivalence bound | |
Specifies the null mean difference | |
Specifies the null mean ratio | |
Specifies the number of sides and the direction of the statistical test or confidence interval | |
Specifies the upper equivalence bound | |
Specify Effects | |
Specifies the desired confidence interval half-width | |
Specifies the two group means | |
Specifies the mean difference | |
Specify Variability | |
Specifies the common coefficient of variation | |
Specifies the standard deviation of each group | |
Specifies the common standard deviation | |
Specify Sample Size and Allocation | |
Specifies the two group sample sizes | |
Specifies the sample size allocation weights for the two groups | |
Enables fractional input and output for sample sizes | |
Specifies the common sample size per group | |
Specifies the sample size | |
Specify Power and Related Probabilities | |
Specifies the desired power of the test | |
Specifies the type of probability for the PROBWIDTH= option | |
Specifies the desired probability of obtaining a confidence interval half-width less than or equal to the value specified | |
Control Ordering in Output | |
Controls the output order of parameters | |
Table 91.27 summarizes the valid result parameters for different analyses in the TWOSAMPLEMEANS statement.
Table 91.27: Summary of Result Parameters in the TWOSAMPLEMEANS Statement
Analyses | Solve For | Syntax |
|---|---|---|
TEST=DIFF | Power | |
Sample size | ||
Group sample size | GROUPNS= n1 | . | |
GROUPNS=. | n2 | ||
GROUPNS= (n1 .) | ||
GROUPNS= (. n2) | ||
Group weight | GROUPWEIGHTS= w1 | . | |
GROUPWEIGHTS=. | w2 | ||
GROUPWEIGHTS= (w1 .) | ||
GROUPWEIGHTS= (. w2) | ||
Alpha | ||
Group mean | GROUPMEANS= mean1 | . | |
GROUPMEANS=. | mean2 | ||
GROUPMEANS= (mean1 .) | ||
GROUPMEANS= (. mean2) | ||
Mean difference | ||
Standard deviation | ||
TEST=DIFF_SATT | Power | |
Sample size | ||
TEST=RATIO | Power | |
Sample size | ||
TEST=EQUIV_DIFF | Power | |
Sample size | ||
TEST=EQUIV_RATIO | Power | |
Sample size | ||
CI=DIFF | Prob(width) | |
Sample size | ||
Dictionary of Options
Restrictions on Option Combinations
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)
Option Groups for Common Analyses
This section summarizes the syntax for the common analyses that are supported in the TWOSAMPLEMEANS statement.
Two-Sample t Test Assuming Equal Variances
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;
Two-Sample Satterthwaite t Test Assuming Unequal Variances
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;
Two-Sample Pooled t Test of Mean Ratio with Lognormal Data
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;
Additive Equivalence Test for Mean Difference with Normal Data
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;
Multiplicative Equivalence Test for Mean Ratio with Lognormal Data
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;
Confidence Interval for Mean Difference
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;