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 89.23 summarizes the options available in the TWOSAMPLEMEANS statement.
Table 89.23: 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 |
|
Specifies the geometric mean ratio, |
|
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 89.24 summarizes the valid result parameters for different analyses in the TWOSAMPLEMEANS statement.
Table 89.24: Summary of Result Parameters in the TWOSAMPLEMEANS Statement
Analyses |
Solve For |
Syntax |
---|---|---|
TEST= DIFF |
Power |
POWER= . |
Sample size |
NTOTAL= . |
|
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 |
||
Standard deviation |
STDDEV= . |
|
TEST= DIFF_SATT |
Power |
POWER= . |
Sample size |
NTOTAL= . |
|
TEST= RATIO |
Power |
POWER= . |
Sample size |
NTOTAL= . |
|
TEST= EQUIV_DIFF |
Power |
POWER= . |
Sample size |
NTOTAL= . |
|
TEST= EQUIV_RATIO |
Power |
POWER= . |
Sample size |
NTOTAL= . |
|
CI= DIFF |
Prob(width) |
|
Sample size |
NTOTAL= . |
|
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;