PROC TTEST Statement 
The PROC TTEST statement invokes the procedure. Table 95.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 testbased mean confidence intervals when the TOST option is used) are to be % confidence intervals, where . When the TOST option is used, the testbased 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 equaltailed 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 TwoIndependentSample Design.
requests the Cochran and Cox (1950) approximation of the probability level for the unequal variances situation. For more information, see the section TwoIndependentSample 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 onesample design) and H0=1 when TEST=RATIO (or DIST=LOGNORMAL for a onesample 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 order in which to sort the levels of the classification variables (which are specified in the CLASS statement) and treatment variables (which are 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.
This option applies to the levels for all classification or treatment variables, except when you use the ORDER=FORMATTED option with numeric classification or treatment variables that have no explicit format. With this option, the levels of such variables are ordered by their internal value.
The ORDER= option can take the following values:
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 charactervalued; same as ORDER=INTERNAL otherwise (the unformatted variable is numericvalued). 
For FORMATTED and INTERNAL, the sort order is machinedependent.
For more information about sorting order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BYgroup 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))
ODS Graphics must be enabled before requesting plots. For example:
ods graphics on; proc ttest plots=all; var oxygen; run; ods graphics off;
For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 21, Statistical Graphics Using ODS.
If ODS Graphics is enabled but you 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 onesample design, the default plots are the following:
summary plot (histogram with overlaid normal and kernel densities, box plot, and confidence interval band)
QQ plot
For a twoindependentsample design, the default plots are the following:
summary plot (comparative histograms with overlaid densities and box plots)
QQ 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
QQ 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
QQ 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 onesample and paired designs, the null value can appear in SUMMARY, BOX, and INTERVAL. For twoindependentsample 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 onesample 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 twoindependentsample 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 onesample 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 twoindependentsample 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 twoindependentsample design, the INTERVAL plot request has the following options:
shows two separate twosided 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 twoindependentsample designs.
For a crossover design, The INTERVAL plot request has the following options:
shows four separate twosided intervals, one for each treatmentbyperiod 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 quantilequantile (QQ) plot. This plot is produced by default for all designs.
For twosample designs, separate plots are shown for each class in a single panel. For crossover design, separate plots are shown for each treatmentbyperiod combination in a single panel.
See the section QQ 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 onesample, paired, and twoindependentsample 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 testbased confidence intervals. The values are interpreted as follows:
(the default) specifies twosided tests and confidence intervals for means.
specifies lower onesided tests, in which the alternative hypothesis indicates a mean less than the null value, and lower onesided confidence intervals between minus infinity and the upper confidence limit.
specifies upper onesided tests, in which the alternative hypothesis indicates a mean greater than the null value, and upper onesided 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 onesample 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.