The TTEST Procedure |
PROC TTEST Statement |
The PROC TTEST statement invokes the procedure. Table 92.2 summarizes the options in the PROC TTEST statement by function. The options are then described fully in alphabetical order.
Option |
Description |
---|---|
Basic Options |
|
specifies input data set |
|
determines sort order of CLASS variable or CROSSOVER treatment variables |
|
Analysis Options |
|
specifies confidence level |
|
specifies distributional assumption (normal or lognormal) |
|
specifies null value |
|
specifies number of sides and direction |
|
specifies test criterion (difference or ratio) |
|
requests equivalence test and specifies bounds |
|
Displayed Output |
|
requests confidence interval for standard deviation or CV |
|
requests Cochran test |
|
produces ODS statistical graphics |
|
Output Ordering |
|
groups results by tables |
The following options can appear in the PROC TTEST statement.
specifies that confidence intervals (except test-based mean confidence intervals when the TOST option is used) are to be % confidence intervals, where . When the TOST option is used, the test-based mean confidence intervals are % confidence intervals. By default, PROC TTEST uses ALPHA=0.05. If is 0 or less, or 1 or more, an error message is printed.
groups the results by the PAIRED or VAR variables. The BYVAR option is enabled by default. Note that this represents a change from previous releases for how the results are grouped with respect to variables and tables. Prior to SAS 9.2, multiple variables were included in each table, similar to the new NOBYVAR option.
specifies whether a confidence interval is displayed for and, if so, what kind. The CI=EQUAL option specifies an equal-tailed confidence interval, and it is the default. The CI=UMPU option specifies an interval based on the uniformly most powerful unbiased test of . The CI=NONE option requests that no confidence interval be displayed for . The values EQUAL and UMPU together request that both types of confidence intervals be displayed. If the value NONE is specified with one or both of the values EQUAL and UMPU, NONE takes precedence. For more information, see the section Two-Independent-Sample Design.
requests the Cochran and Cox (1950) approximation of the probability level for the unequal variances situation. For more information, see the section Two-Independent-Sample Design.
names the SAS data set for the procedure to use. By default, PROC TTEST uses the most recently created SAS data set. The input data set can contain summary statistics of the observations instead of the observations themselves. The number, mean, and standard deviation of the observations are required for each BY group (one sample and paired differences) or for each class within each BY group (two samples). For more information about the DATA= option, see the section Input Data Set of Statistics.
specifies the underlying distribution assumed for the data. The default is NORMAL, unless TEST=RATIO is specified, in which case the default is LOGNORMAL.
requests tests against a null value of , unless the TOST option is used, in which case is merely used to derive the lower and upper equivalence bounds. For the crossover design, the value applies for both treatment and period tests. By default, PROC TTEST uses H0=0 when TEST=DIFF (or DIST=NORMAL for a one-sample design) and H0=1 when TEST=RATIO (or DIST=LOGNORMAL for a one-sample design).
includes all PAIRED or VAR variables together in each output table. If the NOBYVAR option is not specified, then the BYVAR option is enabled, grouping the results by the PAIRED and VAR variables.
specifies the sorting order for the levels of the classification variable (specified in the CLASS statement) and treatment variables (specified in the CROSSOVER option in the VAR statement). The default is ORDER=MIXED, which corresponds to the ordering in releases previous to SAS 9.2.
The following table shows how PROC TTEST interprets values of the ORDER= option.
Value of ORDER= |
Levels Sorted By |
---|---|
DATA |
order of appearance in the input data set |
FORMATTED |
external formatted value, except for numeric variables with no explicit format, which are sorted by their unformatted (internal) value |
FREQ |
descending frequency count; levels with the most observations come first in the order. In the event of a tie, ORDER=MIXED is used. |
INTERNAL |
unformatted value |
MIXED |
same as ORDER=FORMATTED if the unformatted variable is character-valued; same as ORDER=INTERNAL otherwise (unformatted variable is numeric-valued) |
For FORMATTED and INTERNAL, the sort order is machine dependent. For more information about sorting order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BY-group processing in SAS Language Reference: Concepts.
controls the plots produced through ODS Graphics. When you specify only one plot request, you can omit the parentheses around the plot request. Here are some examples:
plots=none plots=(histogram boxplot interval qq profiles agreement) plots(unpack)=summary plots(showh0)=interval(type=pergroup) plots=(summary(unpack) interval(type=period))
You must enable ODS Graphics before requesting plots, for example, like this:
ods graphics on; proc ttest plots=all; var oxygen; run; ods graphics off;
For general information about ODS Graphics, see Chapter 21, Statistical Graphics Using ODS. If you have enabled ODS Graphics but do not specify the PLOTS option, then PROC TTEST produces a default set of plots. ( Note:The graphical results are unavailable if your input data set contains summary statistics rather than observation values.)
For a one-sample design, the default plots are the following:
summary plot (histogram with overlaid normal and kernel densities, box plot, and confidence interval band)
Q-Q plot
For a two-independent-sample design, the default plots are the following:
summary plot (comparative histograms with overlaid densities and box plots)
Q-Q plot
For a paired design, the default plots are the following:
summary plot (histogram, densities, box plot, and confidence interval) of the difference or ratio
Q-Q plot of the difference or ratio
profiles plot
agreement plot
For a crossover design, the default plots are the following:
comparative histograms with overlaid densities by treatment and period
comparative box plots by treatment and period
Q-Q plots by treatment and period
profiles over treatment plot
agreement of treatments plot
For more detailed descriptions of plots, see the section Interpreting Graphs.
The global plot options include the following:
suppresses the default plots. Only plots specifically requested are displayed.
shows the null value (as specified by the H0= option in the PROC TTEST statement) in all relevant plots. For one-sample and paired designs, the null value can appear in SUMMARY, BOX, and INTERVAL. For two-independent-sample and crossover designs, the null value can appear only in INTERVAL.
suppresses paneling. By default, multiple plots can appear in some output panels. Specify UNPACKPANEL to get each plot in a separate panel. You can specify PLOTS(UNPACKPANEL) to unpack the default plots. You can also specify UNPACK as a suboption with SUMMARY.
The plot requests include the following:
produces all appropriate plots. You can specify other options with ALL; for example, to request all plots and specify that intervals should be for the period difference in a crossover design, specify PLOTS=(ALL INTERVAL(TYPE=PERIOD)).
requests an agreement plot. This plot is produced by default for paired and crossover designs, the only designs for which the AGREEMENT option is valid.
For paired designs, the second response in each pair is plotted against the first response. See the section Agreement Plots for Paired Designs for further details.
For crossover designs, the AGREEMENT plot request has the following options:
plots the response in the second period against the response in the first period. See the section Period Agreement Plots for Crossover Designs for further details.
plots the response associated with the second treatment against the response associated with the first treatment. This is the default TYPE= option for crossover designs. See the section Treatment Agreement Plots for Crossover Designs for further details.
requests a box plot or comparative box plots. This plot is produced by default for crossover designs. For other designs, a box plot appears as part of the SUMMARY plot by default.
For one-sample and paired designs, a confidence interval for the mean is shown as a band in the background, along with the equivalence bounds if the TOST option is used in the PROC TTEST statement.
For a two-independent-sample design, comparative box plots (one for each class) are shown. For a crossover design, comparative box plots for all four combinations of the two treatments and two periods are shown.
See the section Box Plots for further details.
requests a histogram or comparative histograms with overlaid normal and kernel densities. This plot is produced by default for crossover designs. For other designs, it appears as part of the SUMMARY plot by default.
For one-sample and paired designs, the histogram and densities are based on the test criterion (which is the mean difference or ratio for a paired design). For a two-independent-sample design, comparative histograms (one for each class) are shown. For a crossover design, histograms for all four combinations of the two treatments and two periods are shown.
See the section Histograms for further details.
requests plots of confidence interval for means.
For a two-independent-sample design, the INTERVAL plot request has the following options:
shows two separate two-sided confidence intervals, one for each class. This option cannot be used along with the SHOWH0 global plot option.
shows pooled and Satterthwaite confidence intervals. This is the default TYPE= option for two-independent-sample designs.
For a crossover design, The INTERVAL plot request has the following options:
shows four separate two-sided intervals, one for each treatment-by-period combination. This option cannot be used along with the SHOWH0 global plot option.
shows pooled and Satterthwaite confidence intervals for the period difference or ratio. This option is invalid if the IGNOREPERIOD option is used in the VAR statement.
shows pooled and Satterthwaite confidence intervals for the treatment difference or ratio. This is the default TYPE= option for crossover designs.
See the section Confidence Intervals for further details.
suppresses all plots.
requests a profiles plot. This plot is produced by default for paired and crossover designs, the only designs for which the PROFILES option is valid.
For paired designs, a line is drawn for each observation from left to right connecting the first response to the second response. See the section Profiles for Paired Designs for further details.
For crossover designs, the PROFILES plot request has the following options:
shows response profiles over period, connecting the first period on the left to the second period on the right for each subject. See the section Profiles over Period for Crossover Designs for further details.
shows response profiles over treatment values, connecting the first treatment on the left to the second treatment on the right for each observation. This is the default TYPE= option for crossover designs. See the section Profiles over Treatment for Crossover Designs for further details.
requests a normal quantile-quantile (Q-Q) plot. This plot is produced by default for all designs.
For two-sample designs, separate plots are shown for each class in a single panel. For crossover design, separate plots are shown for each treatment-by-period combination in a single panel.
See the section Q-Q Plots for further details.
requests HISTOGRAM and BOX plots together in a single panel, sharing common X axes. This plot is produced by default for one-sample, paired, and two-independent-sample designs, the only designs for which the SUMMARY option is valid. See the documentation for the BOX and HISTOGRAM plot requests for details. The SUMMARY plot request has the following option:
specifies the number of sides (or tails) and direction of the statistical tests and test-based confidence intervals. The values are interpreted as follows:
(the default) specifies two-sided tests and confidence intervals for means.
specifies lower one-sided tests, in which the alternative hypothesis indicates a mean less than the null value, and lower one-sided confidence intervals between minus infinity and the upper confidence limit.
specifies upper one-sided tests, in which the alternative hypothesis indicates a mean greater than the null value, and upper one-sided confidence intervals between the lower confidence limit and infinity.
specifies the test criterion. Use TEST=DIFF to test the difference of means and TEST=RATIO to test the ratio of means. The default is DIFF, unless DIST=LOGNORMAL is specified, in which case the default is RATIO. This option is ignored for one-sample designs.
requests Schuirman’s TOST equivalence test. The upper equivalence bound must be specified. If TEST=DIFF, then the default value for the lower equivalence bound is upper, where is the value of the H0= option. If TEST=RATIO, then the default value for lower is upper.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.