Proc Ttest - Sas User Guide
Proc Ttest - Sas User Guide
SAS/STAT 15.3
User’s Guide
The TTEST Procedure
®
SAS Documentation
January 31, 2023
This document is an individual chapter from SAS/STAT® 15.3 User’s Guide.
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2023. SAS/STAT® 15.3 User’s Guide. Cary, NC:
SAS Institute Inc.
SAS/STAT® 15.3 User’s Guide
Copyright © 2023, SAS Institute Inc., Cary, NC, USA
All Rights Reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by
any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute
Inc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time
you acquire this publication.
The scanning, uploading, and distribution of this book via the internet or any other means without the permission of the publisher is
illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic
piracy of copyrighted materials. Your support of others’ rights is appreciated.
January 2023
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the
USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
SAS software may be provided with certain third-party software, including but not limited to open source software, which is licensed
under its applicable third-party software license agreement. For license information about third-party software distributed with SAS
software, refer to Third-Party Software Reference | SAS Support.
Chapter 128
The TTEST Procedure
Contents
Overview: TTEST Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10584
Getting Started: TTEST Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10585
One-Sample t Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10585
Comparing Group Means . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10587
Syntax: TTEST Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10591
PROC TTEST Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10592
BOOTSTRAP Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10601
BY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10603
CLASS Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10604
FREQ Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10604
PAIRED Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10605
VAR Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10605
WEIGHT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10606
Details: TTEST Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10606
Input Data Set of Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10606
Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10607
Computational Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10607
Common Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10607
Arithmetic and Geometric Means . . . . . . . . . . . . . . . . . . . . . . . 10608
Coefficient of Variation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10608
One-Sample Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10608
Paired Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10611
Two-Independent-Sample Design . . . . . . . . . . . . . . . . . . . . . . . 10612
AB/BA Crossover Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 10617
TOST Equivalence Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10618
Bootstrap Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10619
Displayed Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10628
ODS Table Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10632
ODS Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10632
ODS Graph Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10633
Interpreting Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10636
Examples: TTEST Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10638
Example 128.1: Using Summary Statistics to Compare Group Means . . . . . . . . . 10638
Example 128.2: One-Sample Comparison with the FREQ Statement . . . . . . . . . . 10641
Example 128.3: Paired Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . 10644
Example 128.4: AB/BA Crossover Design . . . . . . . . . . . . . . . . . . . . . . . 10649
10584 F Chapter 128: The TTEST Procedure
Feature Syntax
Design
One-sample VAR statement
Paired PAIRED statement
Two-independent-sample CLASS statement, VAR statement
AB/BA crossover VAR / CROSSOVER=
Analysis Criterion
Mean difference PROC TTEST TEST=DIFF
Mean ratio PROC TTEST TEST=RATIO
Hypothesis
Two-sided PROC TTEST SIDES=2
Equivalence PROC TTEST TOST ( < lower , > upper )
Lower one-sided PROC TTEST SIDES=L
Upper one-sided PROC TTEST SIDES=U
Distribution
Normal PROC TTEST DIST=NORMAL
Lognormal PROC TTEST DIST=LOGNORMAL
Empirical, resampled with replacement BOOTSTRAP statement
FREQ and WEIGHT statements are available. Data can be input in the form of observations or, in certain cases,
summary statistics. Output includes summary statistics; confidence limits for means, standard deviations, and
coefficients of variation; hypothesis tests; bootstrap analyses; and a variety of graphical displays for both the
input data set and bootstrap samples, including histograms, densities, box plots, confidence intervals, Q-Q
plots, profiles, agreement plots, and correlation plots.
PROC TTEST uses ODS Graphics to create graphs as part of its output. For general information about ODS
Getting Started: TTEST Procedure F 10585
Graphics, see Chapter 24, “Statistical Graphics Using ODS.” For specific information about the statistical
graphics available with the TTEST procedure, see the PLOTS option in the PROC TTEST statement and the
section “ODS Graphics” on page 10632.
One-Sample t Test
A one-sample t test can be used to compare a sample mean to a given value. This example, taken from
Huntsberger and Billingsley (1989, p. 290), tests whether the mean length of a certain type of court case is
more than 80 days by using 20 randomly chosen cases. The data are read by the following DATA step:
data time;
input time @@;
datalines;
43 90 84 87 116 95 86 99 93 92
121 71 66 98 79 102 60 112 105 98
;
The only variable in the data set, time, is assumed to be normally distributed. The trailing at signs (@@)
indicate that there is more than one observation on a line. The following statements invoke PROC TTEST for
a one-sample t test:
Variable: time
90% 90%
Mean CL Mean Std Dev CL Std Dev
89.8500 84.1659 Infty 19.1456 15.2002 26.2374
DF t Value Pr > t
19 2.30 0.0164
Summary statistics appear at the top of the output. The sample size (N), mean, standard deviation, and
standard error are displayed with the minimum and maximum values of the time variable. The 90% confidence
limits for the mean and standard deviation are shown next. Due to the SIDES=U option, the interval for the
mean is an upper one-sided interval with a finite lower bound (84.1659 days). The limits for the standard
deviation are the equal-tailed variety, per the default CI=EQUAL option in the PROC TTEST statement. At
the bottom of the output are the degrees of freedom, t statistic value, and p-value for the t test. At the 10% ˛
level, this test indicates that the mean length of the court cases is significantly greater than from 80 days (t =
2.30, p = 0.0164).
The summary panel in Figure 128.2 shows a histogram with overlaid normal and kernel densities, a box plot,
the 90% confidence interval for the mean, and the null value of 80 days.
The confidence interval excludes the null value, consistent with the rejection of the null hypothesis at ˛ = 0.1.
The Q-Q plot in Figure 128.3 assesses the normality assumption.
The curvilinear shape of the Q-Q plot suggests a possible slight deviation from normality. You could use the
UNIVARIATE procedure with the NORMAL option to numerically check the normality assumptions.
test scores for two third-grade classes, where one of the classes receives tutoring
fuel efficiency readings of two automobile nameplates, where each nameplate uses the same fuel
sunburn scores for two sunblock lotions, each applied to a different group of people
10588 F Chapter 128: The TTEST Procedure
In the following example, the golf scores for males and females in a physical education class are compared.
The sample sizes from each population are equal, but this is not required for further analysis. The scores
are thought to be approximately normally distributed within gender. The data are read by the following
statements:
data scores;
input Gender $ Score @@;
datalines;
f 75 f 76 f 80 f 77 f 80 f 77 f 73
m 82 m 80 m 85 m 85 m 78 m 87 m 82
;
The dollar sign ($) following Gender in the INPUT statement indicates that Gender is a character variable.
The trailing at signs (@@) enable the procedure to read more than one observation per line.
You can use a group t test to determine whether the mean golf score for the men in the class differs significantly
from the mean score for the women. If you also suspect that the distributions of the golf scores of males
and females have unequal variances, then you might want to specify the COCHRAN option in order to use
the Cochran approximation (in addition to the Satterthwaite approximation, which is included by default).
The following statements invoke PROC TTEST for the case of unequal variances, along with both types of
confidence limits for the pooled standard deviation.
Variable: Score
Simple statistics for the two populations being compared, as well as for the difference of the means between
Comparing Group Means F 10589
the populations, are displayed in Figure 128.4. The Gender column indicates the population that corresponds
to the statistics in that row, and the Method column indicates the method for estimating the standard
deviation, either pooled (assuming equal variances for males and females) or Satterthwaite (assuming unequal
variances). The sample size (N), mean, standard deviation, standard error, and minimum and maximum
values are displayed.
Confidence limits for means and standard deviations are shown in Figure 128.5.
95%
95% UMPU CL Std
Gender Method Mean 95% CL Mean Std Dev CL Std Dev Dev
f 76.8571 74.5036 79.2107 2.5448 1.6399 5.6039 1.5634 5.2219
m 82.7143 79.8036 85.6249 3.1472 2.0280 6.9303 1.9335 6.4579
Diff (1-2) Pooled -5.8571 -9.1902 -2.5241 2.8619 2.0522 4.7242 2.0019 4.5727
Diff (1-2) Satterthwaite -5.8571 -9.2064 -2.5078
For the mean difference, both pooled and Satterthwaite 95% intervals are shown. Equal-tailed and UMPU
confidence limits are shown for the standard deviation under the assumption of equal variances.
The test statistics, associated degrees of freedom, and p-values are displayed in Figure 128.6.
The Method column denotes which t test is being used for that row, and the Variances column indicates
what assumption about variances is being made. The pooled test assumes that the two populations have
equal variances and uses degrees of freedom n1 C n2 2, where n1 and n2 are the sample sizes for the
two populations. The remaining two tests do not assume that the populations have equal variances. The
Satterthwaite test uses the Satterthwaite approximation for degrees of freedom, while the Cochran test uses
the Cochran and Cox approximation for the p-value. All three tests result in highly significant p-values,
supporting the conclusion of a significant difference between males’ and females’ golf scores.
The “Equality of Variances” test in Figure 128.7 reveals insufficient evidence of unequal variances (the
Folded F statistic F 0 = 1.53, with p = 0.6189).
Equality of Variances
Method Num DF Den DF F Value Pr > F
Folded F 6 6 1.53 0.6189
The summary panel in Figure 128.8 shows comparative histograms, normal and kernel densities, and box
plots, comparing the distribution of golf scores between genders.
10590 F Chapter 128: The TTEST Procedure
The Q-Q plots in Figure 128.9 assess the normality assumption for each gender.
Syntax: TTEST Procedure F 10591
The plots for both males and females show no obvious deviations from normality. You can check the
assumption of normality more rigorously by using PROC UNIVARIATE with the NORMAL option; if the
assumption of normality is not reasonable, you should analyze the data with the nonparametric Wilcoxon
rank sum test by using PROC NPAR1WAY.
The PROC TTEST statement invokes the TTEST procedure. Table 128.2 summarizes the options available
in the PROC TTEST statement. The options are then described fully in alphabetical order.
Option Description
Basic Options
DATA= Specifies input data set
ORDER= Determines sort order of CLASS variable or CROSSOVER=
treatment variables
Analysis Options
ALPHA= Specifies 1 – confidence level
DIST= Specifies distributional assumption (normal or lognormal)
H0= Specifies null value
SIDES= Specifies number of sides and direction
TEST= Specifies test criterion (difference or ratio)
TOST Requests equivalence test and specifies bounds
Displayed Output
CI= Requests confidence interval for standard deviation or coefficient
of variation
COCHRAN Requests Cochran t test
PLOTS Produces ODS statistical graphics
Output Ordering
BYVAR Groups results by variables that are specified in the PAIRED or
VAR statement
NOBYVAR Groups results by tables
ALPHA=p
specifies that confidence intervals (except test-based mean confidence intervals when you specify the
TOST option) are to be 100(1 – p)% confidence intervals, where 0 < p < 1. When you specify the
TOST option, the test-based mean confidence intervals are 100(1 – 2p)% confidence intervals. For
the PLOTS=BOOTSTRAP(CORRELATION) option, the ALPHA= option specifies that the elliptical
prediction region is to be a 100(1 – p)% prediction region. If p is 0 or less, or 1 or more, an error
message is printed. By default, ALPHA=0.05.
PROC TTEST Statement F 10593
BYVAR
groups the results by the variables that are specified in the PAIRED or VAR statement. 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.
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” on page 10612.
By default, CI=EQUAL.
COCHRAN
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” on page 10612.
DATA=SAS-data-set
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” on page 10606.
DIST=LOGNORMAL | NORMAL
specifies the underlying distribution assumed for the data. You can specify the following values:
H0=m
requests tests against a null value of m, unless the TOST option is used, in which case m is merely
used to derive the lower and upper equivalence bounds. For the crossover design, the value m applies
for both treatment and period tests. By default, 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).
10594 F Chapter 128: The TTEST Procedure
NOBYVAR
includes all variables that are specified in the PAIRED or VAR statement 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.
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 plots can be requested. For example:
PROC TTEST Statement F 10595
For more information about enabling and disabling ODS Graphics, see the section “Enabling and
Disabling ODS Graphics” on page 663 in Chapter 24, “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. (N OTE : 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) for the input data set
Q-Q plot for the input data set
summary plot of bootstrap statistics, if you specify the BOOTSTRAP statement
Q-Q plot of bootstrap statistics, if you specify the BOOTSTRAP statement
correlation plot of bootstrap statistics, if you specify the BOOTSTRAP statement
summary plot (comparative histograms with overlaid densities and box plots) for the input data
set
Q-Q plot for the input data set
summary plot of bootstrap statistics, if you specify the BOOTSTRAP statement
Q-Q plot of bootstrap statistics, if you specify the BOOTSTRAP statement
correlation plot of bootstrap statistics, if you specify the BOOTSTRAP statement
summary plot (histogram, densities, box plot, and confidence interval) of the difference or ratio
for the input data set
Q-Q plot of the difference or ratio for the input data set
profiles plot for the input data set
agreement plot for the input data set
summary plot of bootstrap statistics, if you specify the BOOTSTRAP statement
Q-Q plot of bootstrap statistics, if you specify the BOOTSTRAP statement
correlation plot of bootstrap statistics, if you specify the BOOTSTRAP statement
comparative histograms with overlaid densities by treatment and period for the input data set
comparative box plots by treatment and period for the input data set
Q-Q plots by treatment and period for the input data set
profiles over treatment plot for the input data set
agreement of treatments plot for the input data set
For more detailed descriptions of plots, see the section “Interpreting Graphs” on page 10636.
You can specify the following global-plot-options:
ONLY
suppresses the default plots. Only plots that you specifically request are displayed.
SHOWH0
SHOWNULL
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 when you also specify the
SUMMARY, BOOTSTRAP(SUMMARY), BOOTSTRAP(BOX), BOOTSTRAP(INTERVAL),
BOX, or INTERVAL plot-request . For two-independent-sample designs and crossover designs,
the null value can appear when you specify the BOOTSTRAP(INTERVAL) or INTERVAL plot-
request . For crossover designs, the null value can appear only when you specify the INTERVAL
plot-request .
UNPACKPANEL
UNPACK
suppresses paneling. By default, multiple plots can appear in some output panels. Specify this
option to get each plot in a separate panel. You can specify PLOTS(UNPACKPANEL) to unpack
the default plots.
ALL
produces all appropriate plots. You can specify other plot-requests 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)).
TYPE=PERIOD
plots the response in the second period against the response in the first period. For more
information, see the section “Period Agreement Plots for Crossover Designs” on page 10636.
TYPE=TREATMENT
plots the response associated with the second treatment against the response associated with
the first treatment. For more information, see the section “Treatment Agreement Plots for
Crossover Designs” on page 10636.
BOX
BOXPLOT
produces box plots of bootstrap mean and standard deviation.
A bootstrap confidence interval is shown as a band in the background if the specified value
of the BOOTCI= option in the BOOTSTRAP statement is capable of producing confidence
intervals for the bootstrap statistic.
For more information, see the section “Box Plots” on page 10637.
CORRELATION
CORR
produces a scatter plot of bootstrap standard deviation versus mean statistics with an overlaid
elliptical prediction region.
This correlation plot is produced by default for one-sample, two-sample, and paired designs
if you specify the BOOTSTRAP statement.
For more information, see the section “Bootstrap Correlation Plots” on page 10638.
HISTOGRAM
HIST
HISTDENS
produces histograms along with overlaid normal and kernel densities for bootstrap mean and
standard deviation.
For more information, see the section “Histograms” on page 10637.
INTERVAL
INTERVALPLOT
produces plots of bootstrap confidence intervals for the mean and standard deviation.
For more information, see the section “Confidence Intervals” on page 10637.
10598 F Chapter 128: The TTEST Procedure
QQ
QQPLOT
produces normal quantile-quantile (Q-Q) plots of the bootstrap mean and standard deviation.
These plots are produced by default for one-sample, two-sample, and paired designs if you
specify the BOOTSTRAP statement.
For more information, see the section “Q-Q Plots” on page 10638.
UNPACK
plots bootstrap histograms along with overlaid densities in one panel and bootstrap box
plots (along with confidence interval bands, if applicable) in another panel. Note that
specifying PLOTS(ONLY)=BOOTSTRAP(SUMMARY(UNPACK)) is exactly the same
as specifying PLOTS(ONLY)=BOOTSTRAP(BOX HISTOGRAM).
By default, if you specify the BOOTSTRAP statement, then the SUMMARY, QQ, and CORRE-
LATION bootstrap-plot-requests are included unless you exclude them by specifying the ONLY
global-plot-option.
BOX
BOXPLOT
produces a box plot or comparative box plots for the input data set. A box plot is produced by
default for crossover designs. For other designs, a box plot appears by default if you specify the
SUMMARY or ALL plot-request .
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.
For more information, see the section “Box Plots” on page 10637.
HISTOGRAM
HIST
HISTDENS
produces a histogram or comparative histograms along with overlaid normal and kernel densities
for the input data set. A histogram is produced by default for crossover designs. For other designs,
it appears by default if you specify the SUMMARY or ALL plot-request .
PROC TTEST Statement F 10599
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.
For more information, see the section “Histograms” on page 10637.
TYPE=PERGROUP
shows two separate two-sided confidence intervals, one for each class. You cannot use this
option along with the SHOWH0 global-plot-option.
TYPE=TEST
shows pooled and Satterthwaite confidence intervals.
TYPE=PERGROUP
shows four separate two-sided intervals, one for each treatment-by-period combination. You
cannot use this option along with the SHOWH0 global-plot-option.
TYPE=PERIOD
shows pooled and Satterthwaite confidence intervals for the period difference or ratio. This
option is invalid if you specify the IGNOREPERIOD option in the VAR statement.
TYPE=TREATMENT
shows pooled and Satterthwaite confidence intervals for the treatment difference or ratio.
NONE
suppresses all plots.
TYPE=PERIOD
shows response profiles over period, connecting the first period on the left to the second
period on the right for each subject. For more information, see the section “Profiles over
Period for Crossover Designs” on page 10637.
TYPE=TREATMENT
shows response profiles over treatment values, connecting the first treatment on the left to
the second treatment on the right for each observation. For more information, see the section
“Profiles over Treatment for Crossover Designs” on page 10638.
By default, TYPE=TREATMENT for crossover designs.
QQ
QQPLOT
produces a normal quantile-quantile (Q-Q) plot for the input data set. 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.
For more information, see the section “Q-Q Plots” on page 10638.
SUMMARY < UNPACK >
SUMMARYPLOT < UNPACK >
produces histogram and box plots for the input data set together in a single panel, where the
plots share common X axes. These plots are produced by default for one-sample, paired, and
two-independent-sample designs, the only designs for which this option is valid. For more
information, see the documentation for the BOX and HISTOGRAM plot-requests. You can
specify the following option:
UNPACK
plots histograms along with overlaid densities in one panel and box plots (along with
confidence interval bands, for one-sample and paired designs) in another panel. Note
that specifying PLOTS(ONLY)=SUMMARY(UNPACK) is exactly the same as specifying
PLOTS(ONLY)=(BOX HISTOGRAM).
SIDES=2 | L | U
SIDED=2 | L | U
SIDE=2 | L | U
specifies the number of sides (or tails) and direction of the statistical tests and test-based confidence
intervals. The values are interpreted as follows:
By default, SIDES=2.
BOOTSTRAP Statement F 10601
TEST=DIFF | RATIO
specifies the test criterion. This option is ignored for one-sample designs. You can specify the following
values:
By default, TEST=DIFF, unless you specify DIST=LOGNORMAL, in which case the default is
TEST=RATIO.
BOOTSTRAP Statement
BOOTSTRAP < / options > ;
The BOOTSTRAP statement requests bootstrap standard error, bias estimates, and confidence intervals.
These bootstrap statistics are currently available only for one-sample, paired, and two-sample designs and
only for analyses that assume normal data—although the bootstrap methods themselves do not necessarily
assume normality.
Bootstrap results are unavailable if you specify the TEST=RATIO, DIST=LOGNORMAL, or TOST option
in the PROC TTEST statement; if you specify the CROSSOVER= option in the VAR statement; or if you
specify the WEIGHT statement. They are also unavailable if your input data set contains summary statistics
rather than raw observed values.
The sample statistics for which bootstrap standard error, bias estimates, and confidence intervals are provided
are as follows:
For a paired design: mean and standard deviation of the paired difference—that is, the difference
between the first and second members of an observation pair
For a two-sample design: mean, pooled standard deviation, and unpooled standard deviation of the
class difference—that is, the difference between an observation from the first class and an observation
from the second class
For more information about how these statistics are computed, see the section “Statistics That Are Resampled”
on page 10623.
You can specify the BOOTSTRAP plot-request option in the PROC TTEST statement to request plots that
are based on bootstrap samples.
10602 F Chapter 128: The TTEST Procedure
Summary of Options
Table 128.4 summarizes the options available in the BOOTSTRAP statement.
Option Description
BOOTCI= Produces bootstrap confidence intervals for the mean and variability parameter estimates
BOOTDATA= Specifies the bootstrap output data set
NSAMPLES= Specifies the number of bootstrap sample data sets (replicates)
SEED= Provides the seed that initializes the random number stream
Dictionary of Options
BOOTCI < = < BC | BOOTT | EXPANDEDPERC | NORMAL | PERCENTILE | TBOOTSE > >
produces bootstrap-based confidence intervals. You can request the following types of bootstrap
confidence interval:
BOOTCI Type
Design Parameter Method BC BOOTT EXPERC NORMAL PERC TBOOTSE
One-sample Mean
Std Dev
Paired Mean (1–2)
Std Dev (1–2)
Two-sample Mean (1–2) Pooled
BY Statement F 10603
BOOTCI Type
Design Parameter Method BC BOOTT EXPERC NORMAL PERC TBOOTSE
Mean (1–2) Satterthwaite () () ()
Std Dev (1–2) Pooled
Std Dev (1–2) Satterthwaite
All six types include confidence intervals for the mean parameter estimate on which the usual hypothesis
test is based, for example, the mean for a one-sample design or the mean difference for a paired or
two-sample design. For BOOTCI=BC and BOOTCI=PERCENTILE, confidence intervals based on the
variability parameter estimate are also produced; these are based on the variability parameter estimate
that is used to compute the standard error of the usual hypothesis test for the mean parameter, for
example, the standard deviation for a one-sample design or the standard deviation of the difference for
a paired or two-sample design.
The ALPHA= and SIDES= options in the PROC TTEST statement set the direction and level of
significance that is used in constructing the bootstrap confidence intervals.
For more information about the bootstrap confidence intervals supported by PROC TTEST, see the
section “Bootstrap Confidence Intervals” on page 10625.
BOOTDATA=SAS-data-set
specifies the SAS data set that contains the bootstrap sample data when you use a BOOTSTRAP
statement. This data set has the number of observations that you specify in the NSAMPLES= option
and contains the mean and standard deviation estimates that are calculated for each bootstrap sample.
NSAMPLES=n
specifies the number of bootstrap sample data sets (replicates). The value must be greater than 1. By
default, NSAMPLES=10000.
SEED=n
provides the seed that initializes the random number stream for generating the bootstrap sample data
sets (replicates). If you do not specify the SEED= value, or if you specify a value less than or equal to
0, the seed is generated from reading the time of day from the computer’s clock.
BY Statement
BY variables ;
You can specify a BY statement in PROC TTEST to obtain separate analyses of observations in groups that
are defined by the BY variables. When a BY statement appears, the procedure expects the input data set to be
sorted in order of the BY variables. If you specify more than one BY statement, only the last one specified is
used.
If your input data set is not sorted in ascending order, use one of the following alternatives:
Sort the data by using the SORT procedure with a similar BY statement.
10604 F Chapter 128: The TTEST Procedure
Specify the NOTSORTED or DESCENDING option in the BY statement in the TTEST procedure.
The NOTSORTED option does not mean that the data are unsorted but rather that the data are arranged
in groups (according to values of the BY variables) and that these groups are not necessarily in
alphabetical or increasing numeric order.
Create an index on the BY variables by using the DATASETS procedure (in Base SAS software).
For more information about BY-group processing, see the discussion in SAS Language Reference: Concepts.
For more information about the DATASETS procedure, see the discussion in the Base SAS Procedures Guide.
CLASS Statement
CLASS variable ;
A CLASS statement giving the name of the classification (or grouping) variable must accompany the PROC
TTEST statement in the two-independent-sample case. It should be omitted for the one-sample, paired, and
AB/BA crossover designs. If it is used without the VAR statement, all numeric variables in the input data set
(except those that appear in the CLASS, BY, FREQ, or WEIGHT statement) are included in the analysis.
The classification variable must have two, and only two, levels. PROC TTEST divides the observations into
the two groups for the t test by using the levels of this variable. You can use either a numeric or a character
variable in the CLASS statement.
Classification levels are determined from the formatted values of the CLASS variable. Thus, you can use
formats to define group levels. For more information, see the discussions of the FORMAT procedure, the
FORMAT statement, formats, and informats in SAS Formats and Informats: Reference.
FREQ Statement
FREQ variable ;
The variable in the FREQ statement identifies a variable that contains the frequency of occurrence of each
observation. PROC TTEST treats each observation as if it appears n times, where n is the value of the FREQ
variable for the observation. If the value is not an integer, only the integer portion is used. If the frequency
value is less than 1 or is missing, the observation is not used in the analysis. When the FREQ statement is not
specified, each observation is assigned a frequency of 1. The FREQ statement cannot be used if the DATA=
data set contains statistics instead of the original observations.
PAIRED Statement F 10605
PAIRED Statement
PAIRED pair-lists ;
The pair-lists in the PAIRED statement identifies the variables to be compared in paired comparisons. You
can use one or more pair-lists. Variables or lists of variables are separated by an asterisk (*) or a colon (:).
The asterisk requests that each variable on the left be compared with each variable on the right. The colon
requests that the first variable on the left be compared with the first on the right, the second on the left with
the second on the right, and so on. The number of variables on the left must equal the number on the right
when the colon is used. The differences are calculated by taking the variable on the left minus the variable on
the right for both the asterisk and colon. A pair that is formed by a variable with itself is ignored. Use the
PAIRED statement only for paired comparisons. The CLASS and VAR statements cannot be used with the
PAIRED statement.
Examples of the use of the asterisk and the colon are shown in Table 128.6.
VAR Statement
VAR variables < / options > ;
The VAR statement names the variables to be used in the analyses. One-sample comparisons are conducted
when the VAR statement is used without the CROSSOVER= option or CLASS statement. Two-independent-
sample comparisons are conducted when the VAR statement is used with a CLASS statement.
An AB/BA crossover analysis is conducted when the CROSSOVER= option is used in the VAR statement. In
this case, you must specify an even number of variables. Each set of two variables represents the responses in
the first and second periods of the AB/BA crossover design. For example, if you use the CROSSOVER=
option and specify VAR x1 x2 x3 x4, then you will get two analyses. One analysis will have x1 as the
period 1 response and x2 as the period 2 response. The other analysis will have x3 as the period 1 response
and x4 as the period 2 response.
The VAR statement cannot be used with the PAIRED statement. If the VAR statement is omitted, all numeric
variables in the input data set (except a numeric variable that appears in the BY, CLASS, FREQ, or WEIGHT
statement) are included in the analysis.
You can specify the following options after a slash (/):
10606 F Chapter 128: The TTEST Procedure
IGNOREPERIOD
ignores the period effect—that is, the period effect is assumed to be equal to 0 (if TEST=DIFF) or
1 (if TEST=RATIO). This assumption increases the degrees of freedom for the test of the treatment
difference by 1 and is usually more powerful, but it risks incorrect results if there is actually a period
effect.
WEIGHT Statement
WEIGHT variable ;
The WEIGHT statement weights each observation in the input data set by the value of the variable. The
values of the variable can be nonintegral, and they are not truncated. Observations that have negative, zero,
or missing values for the variable are not used in the analyses. Each observation is assigned a weight of 1
when the WEIGHT statement is not used. The WEIGHT statement cannot be used with an input data set of
summary statistics.
for the _TYPE_=T observations in output produced by the OUTSTATS= option in the PROC COMPARE
statement (see the Base SAS Procedures Guide).
Missing Values
An observation is omitted from the calculations if it has a missing value for either the CLASS variable, a
CROSSOVER= variable, a PAIRED variable, the variable to be tested (in a one-sample or two-independent-
sample design), or either of the two response variables (in a crossover design). If more than one variable or
pair of variables is listed in the VAR statement, a missing value in one variable or pair does not eliminate the
observation from the analysis of other nonmissing variables or variable pairs.
Computational Methods
This section describes the computational formulas for the estimates, confidence limits, and tests for each
analysis in the TTEST procedure. The first subsection defines some common notation. The second subsection
discusses the distinction between arithmetic and geometric means. The third subsection explains the concept
of the coefficient of variation. The next four subsections address the four supported designs (one-sample,
paired, two-independent-sample, and AB/BA crossover). The content in each of those subsections is divided
into separate discussions according to different values of the DIST= and TEST= options in the PROC TTEST
statement. The next-to-last subsection describes TOST equivalence analyses. The last subsection discusses
bootstrap methods.
Common Notation
Table 128.7 displays notation for some of the commonly used symbols.
Symbol Description
Population value of (arithmetic) mean
0 Null value of test (value of H0= option in PROC TTEST statement)
2 Population variance
Population value of standard deviation
Population value of geometric mean
CV Population value of coefficient of variation (ratio of population
standard deviation and population arithmetic mean)
˛ Value of ALPHA= option in PROC TTEST statement
tp; pth percentile of t distribution with degrees of freedom (df )
Fp;1 ;2 pth percentile of F distribution with 1 numerator df and 2 de-
nominator df
2p; pth percentile of chi-square distribution with df
10608 F Chapter 128: The TTEST Procedure
The geometric mean of the distribution of a random variable X is exp.E.log.X //, the exponentiation of
the mean of the natural logarithm. The geometric mean is the natural parameter of interest for a lognormal
distribution because the distribution of a ratio of lognormal random variables has a known lognormal
distribution, and the geometric mean of a lognormal ratio is equal to the ratio of the individual geometric
means. (No such convenient property holds for arithmetic means with lognormal data, with either differences
or ratios.)
The usual estimate of a geometric mean is the product of the values raised to the power 1=n, where n is the
number of values:
n
! n1
Y
geometric mean D yi
i D1
Coefficient of Variation
The coefficient of variation (abbreviated “CV”) of p the distribution of a random variable X is the ratio of
the standard deviation to the (arithmetic) mean, or Var.X /=E.X /. Conceptually, it is a measure of the
variability of X expressed in units corresponding to the mean of X.
For lognormal data, the CV is the natural measure of variability (rather than the standard deviation) because
the CV is invariant to multiplication of a lognormal variable by a constant. For a two-independent-sample
design, the assumption of equal CVs on a lognormal scale is analogous to the assumption of equal variances
on the normal scale. When the CVs of two independent samples of lognormal data are assumed equal, the
pooled estimate of variability is used.
One-Sample Design
Define the following notation:
The equal-tailed confidence interval for the standard deviation (CI=EQUAL) is based on the acceptance
region of the test of H0 W D 0 that places an equal amount of area ( ˛2 ) in each tail of the chi-square
distribution:
( )
2 .n 1/s 2 2
˛ ;n 1 1 ˛ ;n 1
2 02 2
The acceptance region can be algebraically manipulated to give the following 100(1 – ˛)% confidence
interval for 2 :
0 1
.n 1/s 2 .n 1/s 2
@ ; A
21 ˛ ;n 1 2˛ ;n 1
2 2
Taking the square root of each side yields the 100(1 – ˛)% CI=EQUAL confidence interval for :
00 1 12 0 1 12 1
2 .n 1/s 2 A C
B@ .n 1/s A
@ 2 ; @ 2 A
1 ˛ ;n 1 ˛ ;n 1
2 2
The other confidence interval for the standard deviation (CI=UMPU) is derived from the uniformly most
powerful unbiased test of H0 W D 0 (Lehmann 1986). This test has acceptance region
( )
.n 1/s 2
c1 c2
02
10610 F Chapter 128: The TTEST Procedure
and
Z c2
yfn 1 .y/dy D .n 1/.1 ˛/
c1
where f .y/ is the PDF of the chi-square distribution with degrees of freedom. This acceptance region can
be algebraically manipulated to arrive at
.n 1/s 2 .n 1/s 2
P 2 D1 ˛
c2 c1
where c1 and c2 solve the preceding two integrals. To find the area in each tail of the chi-square distribution
to which these two critical values correspond, solve c1 D 21 ˛2 ;n 1 and c2 D 2˛1 ;n 1 for ˛1 and ˛2 ; the
resulting ˛1 and ˛2 sum to ˛. Hence, a 100(1 – ˛)% confidence interval for 2 is given by
!
.n 1/s 2 .n 1/s 2
;
21 ˛2 ;n 1 2˛1 ;n 1
Taking the square root of each side yields the 100(1 – ˛)% CI=UMPU confidence interval for :
0 ! 12 ! 12 1
2 2
@ .n 1/s ;
.n 1/s A
2
1 ˛2 ;n 1 2˛1 ;n 1
zi D log.yi / ; i 2 f1; : : : ; n? g
0 D log.0 /
First, a DIST=NORMAL analysis is performed on fzi g with the null value 0 , producing the mean estimate
b
N the standard deviation estimate sz , a t value, and a p-value. The geometric mean estimate O and the CV
z,
estimate C V of the original lognormal data are computed as follows:
O D exp.Nz/
b
C V D exp.sz2 / 1
12
The t value and p-value remain the same. The confidence limits for the geometric mean and CV on the
original lognormal scale are computed from the confidence limits for the arithmetic mean and standard
b
deviation in the DIST=NORMAL analysis on the log-transformed data, in the same way that O is derived
from zN and C V is derived from sz .
Computational Methods F 10611
Paired Design
Define the following notation:
Estimates and confidence limits are not computed for this situation.
10612 F Chapter 128: The TTEST Procedure
Two-Independent-Sample Design
Define the following notation:
Under the assumption of equal variances (12 D 22 ), the pooled estimate of the common standard deviation
is
!1
.n1 1/s12 C .n2 1/s22 2
sp D
n1 C n2 2
The pooled standard error (the estimated standard deviation of yNd assuming equal variances) is
0 1 12
1 1
SEp D sp @ P CP ? A
n?1 n2
i D1 f1i w1i i D1 f2i w2i
The pooled 100(1 – ˛)% confidence interval for the mean difference d is
yNd t1 ˛2 ;n1 Cn2 2 SEp ; yNd C t1 ˛2 ;n1 Cn2 2 SEp ; SIDES=2
1 ; yNd C t1 ˛;n1 Cn2 2 SEp ; SIDES=L
yNd t1 ˛;n1 Cn2 2 SEp ; 1 ; SIDES=U
Computational Methods F 10613
Under the assumption of unequal variances (the Behrens-Fisher problem), the unpooled standard error is
computed as
0 1 12
s12 s22
SEu D @ P CP ? A
n?1 n2
i D1 f1i w1i i D1 f2i w2i
Satterthwaite’s (1946) approximation for the degrees of freedom, extended to accommodate weights, is
computed as
SE4u
df u D
s14 s24
2 C 2
Pn? Pn?
1 2
.n1 1/ iD1 f 1i w1i .n2 1/ iD1 f 2i w2i
The unpooled Satterthwaite 100(1 – ˛)% confidence interval for the mean difference d is
yNd t1 ˛2 ;df u SEu ; yNd C t1 ˛2 ;df u SEu ; SIDES=2
1 ; yNd C t1 ˛;df u SEu ; SIDES=L
yNd t1 ˛;df u SEu ; 1 ; SIDES=U
When the COCHRAN option is specified in the PROC TTEST statement, the Cochran and Cox (1950)
approximation of the p-value of the tu statistic is the value of p such that
! !
s12 s22
Pn? t1 C Pn? t2
1 2
i D1 f1i w1i iD1 f2i w2i
tu D ! !
s12 s22
Pn? C Pn?
1 2
iD1 f1i w1i iD1 f2i w2i
10614 F Chapter 128: The TTEST Procedure
where t1 and t2 are the critical values of the t distribution corresponding to a significance level of p and
sample sizes of n1 and n2 , respectively. The number of degrees of freedom is undefined when n1 ¤ n2 . In
general, the Cochran and Cox test tends to be conservative (Lee and Gurland 1975).
The 100(1 – ˛)% CI=EQUAL and CI=UMPU confidence intervals for the common population standard devi-
ation assuming equal variances are computed as discussed in the section “Normal Data (DIST=NORMAL)”
on page 10609 for the one-sample design, except replacing s 2 by sp2 and .n 1/ by .n1 C n2 1/.
The folded form of the F statistic, F 0 , tests the hypothesis that the variances are equal (Steel and Torrie 1980),
where
max.s12 ; s22 /
F0 D
min.s12 ; s22 /
A test of F 0 is a two-tailed F test because you do not specify which variance you expect to be larger. The
p-value (Steel and Torrie 1980) is equal-tailed and is computed as
P s12 =s22 > F1 ˛;df 1 ;df 2 C P s22 =s12 F1 ˛;df 2 ;df 1 ; s12 =s22 1
D
P s12 =s22 F1 ˛;df 1 ;df 2 C P s22 =s12 > F1 ˛;df 2 ;df 1 ; s12 =s22 < 1
where df 1 , df 2 , df a , and df b are the degrees of freedom that correspond to s12 , s12 , max.s12 ; s22 /, and
min.s12 ; s22 /, respectively.
Note that the p-value is similar to the probability p ? of a greater F 0 value under the null hypothesis that
12 D 22 ,
P s12 =s22 > F1 ˛;df 1 ;df 2 C P s22 =s12 F1 ˛;df 1 ;df 2 ; s12 =s22 1
p? D
P s12 =s22 F1 ˛;df 1 ;df 2 C P s22 =s12 > F1 ˛;df 1 ;df 2 ; s12 =s22 < 1
The F 0 test is not very robust to violations of the assumption that the data are normally distributed, and thus
it is not recommended without confidence in the normality assumption.
O r D yN1 =yN2
Computational Methods F 10615
No estimates or confidence intervals for the ratio of standard deviations are computed.
Under the assumption of equal variances (12 D 22 ), the pooled confidence interval for the mean ratio is the
Fieller (1954) confidence interval, extended to accommodate weights. Let
sp2 t12 ˛ ;n Cn 2
1 2
ap D P ?2 yN22
n2
i D1 f2i w2i
bp D yN1 yN2
sp2 t12 ˛ ;n Cn 2
1 2
cp D P ?2 yN12
n1
i D1 f1i w1i
where sp is the pooled standard deviation defined in the section “Normal Difference (DIST=NORMAL
TEST=DIFF)” on page 10612 for the two-independent-sample design. If ap 0 (which occurs when yN2 is
too close to zero), then the pooled two-sided 100(1 – ˛)% Fieller confidence interval for r does not exist. If
a < 0, then the interval is
0
2
12 2
12 1
b ap cp bp ap cp
@ bp C p ;
bp A
ap ap ap ap
which differ from ap and cp only in the use of ˛ in place of ˛=2. If ap? 0, then the pooled one-sided 100(1
– ˛)% Fieller confidence intervals for r do not exist. If ap? < 0, then the intervals are
0
2
1 1
? c? 2
b p b p a p p
@ 1 ; A; SIDES=L
ap? ap?
0
2
1
? c? 2
1
b b a
@ p C p p p
; 1A; SIDES=U
ap? ap?
The pooled t test assuming equal variances is the Sasabuchi (1988a, b) test. The hypothesis H0 W r D 0 is
rewritten as H0 W 1 0 2 D 0, and the pooled t test in the section “Normal Difference (DIST=NORMAL
TEST=DIFF)” on page 10612 for the two-independent-sample design is conducted on the original y1i values
(i 2 f1; : : : ; n?1 g) and transformed values of y2i
?
y2i D 0 y2i ; i 2 f1; : : : ; n?2 g
with a null difference of 0. The t value for the Sasabuchi pooled test is computed as
yN1 0 yN2
tp D ! 12
1 20
sp Pn ? C Pn?
1 2
i D1 f1i w1i i D1 f2i w2i
10616 F Chapter 128: The TTEST Procedure
Under the assumption of unequal variances, the unpooled Satterthwaite-based confidence interval for the
mean ratio r is computed according to the method in Dilba, Schaarschmidt, and Hothorn (2007, the section
“Two-sample Problem” on page 20), extended to accommodate weights. The degrees of freedom for the
confidence interval are based on the same approximation as in Tamhane and Logan (2004) for the unpooled t
test but with the null mean ratio 0 replaced by the maximum likelihood estimate O r D yN1 =yN2 :
!2
s12 O 2r s22
Pn? C Pn ?
1 2
iD1 f1i w1i iD1 f2i w2i
df u D 4
s1 O 4r s24
2 C 2
Pn? Pn?
1 2
.n1 1/ iD1 f1i w1i .n2 1/ iD1 f2i w2i
Let
s22 t12 ˛
2 ;df u
au D P ? yN22
n2
i D1 f2i w2i
bu D yN1 yN2
s12 t12 ˛
2 ;df u
cu D P ? yN12
n1
i D1 f1i w1i
where s1 and s2 are the within-class-level standard deviations defined in the section “Normal Difference
(DIST=NORMAL TEST=DIFF)” on page 10612 for the two-independent-sample design. If au 0 (which
occurs when yN2 is too close to zero), then the unpooled Satterthwaite-based two-sided 100(1 – ˛)% confidence
interval for r does not exist. If au < 0, then the interval is
0 21 21 1
b 2 a c b 2 a c
@ bu C u u u
;
bu u u u
A
au au au au
The t test assuming unequal variances is the test derived in Tamhane and Logan (2004). The hypothesis
H0 W r D 0 is rewritten as H0 W 1 0 2 D 0, and the Satterthwaite t test in the section “Normal
Difference (DIST=NORMAL TEST=DIFF)” on page 10612 for the two-independent-sample design is
conducted on the original y1i values (i 2 f1; : : : ; n?1 g) and transformed values of y2i
?
y2i D 0 y2i ; i 2 f1; : : : ; n?2 g
So fy11i ; : : : ; y11n?1 g and fy22i ; : : : ; y22n?2 g are all observed at treatment level A, and fy12i ; : : : ; y12n?2 g and
fy21i ; : : : ; y21n?1 g are all observed at treatment level B.
Define the period difference for an observation as the difference between period 1 and period 2 response
values:
for k 2 f1; 2g and i 2 f1; : : : ; n?k g . Similarly, the period ratio is the ratio between period 1 and period 2
response values:
The crossover difference for an observation is the difference between treatment A and treatment B response
values:
yk1i yk2i ; k D 1
cdkj i D
yk2i yk1i ; k D 2
Similarly, the crossover ratio is the ratio between treatment A and treatment B response values:
yk1i =yk2i ; k D 1
crkj i D
yk2i =yk1i ; k D 2
In the absence of the IGNOREPERIOD option in the PROC TTEST statement, the data are split into
two groups according to treatment sequence and analyzed as a two-independent-sample design. If
10618 F Chapter 128: The TTEST Procedure
DIST=NORMAL, then the analysis of the treatment effect is based on the half period differences fpdkj i =2g,
and the analysis for the period effect is based on the half crossover differences fcdkj i =2g. The computations
for the normal difference analysis are the same as in the section “Normal Difference (DIST=NORMAL
TEST=DIFF)” on page 10612 for the two-independent-sample design. The normal ratio analysis without the
IGNOREPERIOD option is not supported for the AB/BA crossover design. If DIST=LOGNORMAL, then
p
the analysis of the treatment effect is based on the square root of the period ratios f prkj i g, and the analysis
p
for the period effect is based on the square root of the crossover ratios f crkj i g. The computations are the
same as in the section “Lognormal Ratio (DIST=LOGNORMAL TEST=RATIO)” on page 10614 for the
two-independent-sample design.
If the IGNOREPERIOD option is specified, then the treatment effect is analyzed as a paired analysis on the
(treatment A, treatment B) response value pairs, regardless of treatment sequence. So the set of pairs is taken
to be the concatenation of f.y111 ; y121 /; : : : ; .y11n?1 ; y12n?1 /g and f.y221 ; y211 /; : : : ; .y22n?2 ; y22n?2 /g. The
computations are the same as in the section “Paired Design” on page 10611.
See Senn (2002, Chapter 3) for a more detailed discussion of the AB/BA crossover design.
H0 W < L or > U
H1 WL U
where L and U are the lower and upper bounds specified in the TOST option in the PROC TTEST
statement, and is the analysis criterion (mean, mean ratio, or mean difference, depending on the analysis).
Following the two one-sided tests (TOST) procedure of Schuirmann (1987), the equivalence test is conducted
by performing two separate tests:
Ha0 W < L
Ha1 W L
and
Hb0 W > U
Hb1 W U
The overall p-value is the larger of the two p-values of those tests.
Rejection of H0 in favor of H1 at significance level ˛ occurs if and only if the 100(1 – 2 ˛)% confidence
interval for is contained completely within .L ; U /. So, the 100(1 – 2 ˛)% confidence interval for is
displayed in addition to the usual 100(1 – ˛)% interval.
For further discussion of equivalence testing for the designs supported in the TTEST procedure, see Phillips
(1990); Diletti, Hauschke, and Steinijans (1991); Hauschke et al. (1999).
Computational Methods F 10619
Bootstrap Methods
Overview of the Bootstrap
The bootstrap is based on the plug-in principle and is an extension of the practice of replacing unknown
parameters with estimates (for example, substituting a sample mean for a population mean). The extension
goes all the way to the entire population F from which the data being analyzed are a sample.
The most popular variety of bootstrap is the nonparametric bootstrap, which relies on random sampling
with replacement from the data to estimate the distribution of a sample estimate (or the joint distribution of
multiple sample estimates).
The bootstrap methods in PROC TTEST are all based on the nonparametric bootstrap. The other two main
varieties are the parametric bootstrap (sampling from a model that has estimated parameters) and smoothed
bootstrap (sampling from a continuous distribution estimate).
The heuristic for the nonparametric bootstrap is as follows:
1. Draw n observations with replacement from the original n data points to create a “bootstrap sample.”
O
2. Calculate a statistic of interest, , from the bootstrap sample and denote its computed value as .
The statistics of primary interest in PROC TTEST are the sample mean and sample standard deviation.
Parametric assumptions are violated. For example, 2 intervals for a variance and F-based intervals for
the ratio of variances are not robust to deviations from normality, and their coverage does not improve
even with increasing sample size.
The data are stored in a way that makes calculating formulas impractical.
Bias estimates
Percentile intervals, optionally with corrections for median bias or narrowness bias (or both)
10620 F Chapter 128: The TTEST Procedure
t-based intervals, which are traditional t-based confidence intervals either with the bootstrap standard
error in place of the traditional standard error or with bootstrap quantiles of the t statistic in place of t
distribution quantiles
Bootstrap bias-corrected estimates are usually worse than estimates that are based on the original
sample. Even though they tend to be more accurate, they also tend to have much higher variance.
Educational Value
Hesterberg (2015) points out several educational benefits of the bootstrap:
Because the bootstrap works the same way with a wide variety of statistics, students can focus on ideas
rather than formulas. They can also focus on statistics that are appropriate rather than “well-behaved.”
Plots of the bootstrap distribution can help make the abstract concrete for concepts such as sampling
distributions, standard errors, bias, the central limit theorem, and confidence intervals.
The action of drawing bootstrap samples reinforces the role that random sampling plays in statistics.
The relationship between the bootstrap distribution and the original sample is fundamentally the
same as the relationship between the original sample and the population. Patterns that are observed
in bootstrap samples (for example, excessive narrowness) usually imply similar patterns in random
sampling from the population (for example, the same narrowness that is corrected for with the n=.n 1/
factor in the traditional sample standard deviation estimate).
Politis (2016) explains how bootstrapping can help ease students into understanding the notion of resampling
from an empirical distribution, instilling confidence in mean and variance estimates without relying on
the (often unjustifiable) assumption of normality. He suggests a three-stage approach for guiding students
through this transition:
3. Abandon the parametric paradigm altogether by generating quantiles and percentile intervals from the
resampling distribution. Show when the bootstrap works better or worse than the parametric approach.
Symbol Description
One-Sample Design
n Number of observations
Population mean
2 Population variance
˛ Value of ALPHA= option in PROC TTEST statement, such that the confidence level for all
bootstrap confidence intervals is 100(1 – ˛)%
yi Value of ith observation, i 2 f1; : : : ; ng
Two-Sample Design
n1 Number of observations at the first class level
n2 Number of observations at the second class level
y1i Value of ith observation at the first class level, i 2 f1; : : : ; n1 g
y2i Value of ith observation at the second class level, i 2 f1; : : : ; n2 g
General
zp 100p percentile of standard normal distribution
tp; 100p percentile of t distribution with degrees of freedom
The standard error of O is the standard deviation of its sampling distribution. The degrees of freedom
discussed in this section reflect the values that would be used for t tests for the corresponding designs in
PROC TTEST.
N standard deviation (s), standard error of mean (SE), and degrees of
One-sample estimates for mean (y),
freedom (df) are as follows:
n
1X
yN D yi
n
i D1
n
! 12
1 X
2
sD .yi N
y/
n 1
i D1
p
SE D s= n
df D n 1
Two-sample estimates for within-group means (yN1 and yN2 ), mean difference (yNd ), and within-group standard
10622 F Chapter 128: The TTEST Procedure
Two-sample pooled estimates for standard deviation that is assumed to be common within groups (sp ),
standard error of mean difference (SEp ), and degrees of freedom (df p ) are as follows:
! 12
.n1 1/s12 C .n2 1/s22
sp D
n1 C n2 2
1
1 1 2
SEp D sp C
n1 n2
df p D n1 C n2 2
Note that s 2 , s12 , s22 , and sp2 are all unbiased estimators of their respective variances.
The two-sample unpooled standard error estimate of the mean difference (SEu ) and degrees of freedom
estimate for unpooled (Satterthwaite) t statistic (df u ) are as follows:
! 12
s12 s2
SEu D C 2
n1 n2
SE4u
df u D
s14 s24
C
.n1 1/n21 .n2 1/n22
The one-sample variance of the empirical distribution (O2 ) and the standard error of the empirical distribution
of the mean (ZE) are as follows:
O2
n 1 2
D s
n
p
ZE D =
O n
Computational Methods F 10623
The two-sample pooled variance of the empirical distribution (Op2 ) and the pooled standard error estimate of
the empirical distribution of mean difference (ZEp ) are as follows:
The two-sample unpooled standard error of the empirical distribution of mean difference is defined as
! 21
.n1 1/s12 .n2 1/s22
ZEu D C
n21 n22
Resampling
For the nonparametric bootstrap for a one-sample design, a bootstrap sample is a random draw of n
observations with replacement from the original data set, where O is the statistic that is calculated from a
sample of n iid observations (for example, yN or s), r is the number of independent bootstrap samples, and Oi?
is the value of O for the ith bootstrap sample from the original data, where i 2 f1; : : : ; rg.
The bootstrap for a paired design is identical to the bootstrap for a one-sample design if yi is defined as the
difference between the first and second members of the ith pair.
In a bootstrap for a two-sample design, random draws of size n1 and n2 are taken with replacement from the
first and second groups, respectively, and combined to produce a single bootstrap sample.
n
! 12
1 X
sD .yi N 2
y/
n 1
i D1
For a paired design, the mean of the paired difference di D y1i y2i is estimated by
n
1X
dN D di
n
i D1
n
! 21
1 X
sd D .di dN /2
n 1
i D1
10624 F Chapter 128: The TTEST Procedure
For a two-sample design, the mean d of the class difference dij D y1i y2j is estimated by
n1 n2
1 X 1 X
yNd D yN1 yN2 D y1i y2j
n1 n2
i D1 j D1
Under the assumption of equal variances (12 D 22 ), the pooled estimate of the standard deviation of the
class difference is
! 12
p p .n1 1/s12 C .n2 1/s22
spd D 2sp D 2
n1 C n2 2
Under the assumption of unequal variances, the Satterthwaite estimate of the standard deviation of the class
difference is
q
sud D s12 C s22
r
! 12
1 X
ON?/2
sb D .Oi?
r 1
i D1
Several confidence intervals in the next section are based on quantiles of bootstrap samples. Following the
convention in Efron and Tibshirani (1993, section 12.5), the quantile for an ambiguous case is chosen as the
nearest sample value in the direction toward the center of the bootstrap distribution. This choice ensures that
confidence intervals that are constructed from the quantiles satisfy the desired coverage. In particular, the pth
quantile (100p percentile) qp of the bootstrap distribution of Oi? (or some function of Oi? ) is computed as
follows:
Otherwise, if p 0:5 and L D floor..r C 1/p/ 1, then qp is the Lth largest value.
Otherwise, if p > 0:5 and U D ceil..r C 1/p/ r, then qp is the Uth largest value.
Otherwise (either p 0:5 and L D floor..r C 1/p/ < 1, or p > 0:5 and U D ceil..r C 1/p/ > r),
then qp is undefined and the bootstrap sample must be larger to yield a valid quantile-based confidence
interval.
Computational Methods F 10625
In PROC TTEST, the normal interval with bootstrap standard error is computed only for the mean or mean
difference. Standard confidence intervals for standard deviations are based on the chi-square distribution
rather than on the normal distribution and thus do not have a bootstrap analog of this type.
ˆ . 1; q1 ˛ / ; lower one-sided
.q˛ ; 1/ ; upper one-sided
:
This interval is also the same as the normal interval with bootstrap standard error where normal quantiles are
replaced by t quantiles.
In PROC TTEST, the t interval with bootstrap standard error is computed only for the mean or mean
difference. Standard confidence intervals for standard deviations are based on the chi-square distribution
rather than on the t distribution and thus do not have a bootstrap analog of this type.
The t interval with bootstrap standard error can help students learn formula methods. It performs relatively
well for small n but is not robust to skewness in the data.
Students can compare percentile and t intervals: if they are similar, then they are both probably acceptable.
ˆ . 1; q1 ˛0 / ; lower one-sided
.q˛0 ; 1/ ; upper one-sided
:
Bootstrap t Interval
The bootstrap t interval eschews the assumption of the t statistic having a t distribution and instead uses
quantiles of its bootstrap distribution, along with traditional standard error estimates,
8
ˆ
ˆ O q1 ˛ SO ; O q ˛ SO ; two-sided
ˆ
< 2 2
1; O q˛ SO ; lower one-sided
ˆ
: O q1 ˛ SO ; 1 ;
ˆ
upper one-sided
ˆ
where q are quantiles of O ? O =SO ? and SO is the (non-bootstrap) standard error estimate of O based on
unbiased variance estimates.
In PROC TTEST, the bootstrap t interval is computed only for the mean or mean difference. There is no
reasonable general formula for the standard error of the sample standard deviation.
The bootstrap t interval allows for asymmetry and is “second-order accurate,” satisfying the following
properties for a one-sample design:
robust to bias
robust to skewness
transformation-invariant—that is, intervals for some function of can be obtained by applying the
same transformation to the endpoints
where
˛1 D ˆ 2z0 C z˛=2
˛2 D ˆ 2z0 C z1 ˛=2
˛3 D ˆ .2z0 C z1 ˛/
˛4 D ˆ .2z0 C z˛ /
z0 D ˆ 1 #fOi? < O g=r
Displayed Output
For an AB/BA crossover design, the CrossoverVarInfo table shows the variables that are specified for the
response and treatment values in each period of the design.
The summary statistics in the Statistics table and confidence limits in the ConfLimits table are displayed
for certain variables and/or transformations or subgroups of the variables in the analysis, depending on the
design. For a one-sample design, results are displayed for all variables. For a paired design, results are
displayed for the paired difference if you specify the TEST=DIFF option in the PROC TTEST statement, or
for the paired ratio if you specify TEST=RATIO.
For a two-independent-sample design, most of the results are displayed for each of the two classes, for
the difference (if TEST=DIFF) or ratio of means between classes (if TEST=RATIO), and for the assumed-
common within-class standard deviation (if DIST=NORMAL) or coefficient of variation (if TEST=RATIO).
Results are not displayed for the standard deviation of the class difference or ratio or for the coefficient
of variation of the class ratio. However, the standard errors that are displayed if you specify TEST=DIFF
are the standard deviation estimates of the means of each of the two classes and the pooled and unpooled
(Satterthwaite) standard deviation estimates of the mean class difference. These standard errors are the same
ones that are used in hypothesis tests and confidence limits for means and mean differences.
For an AB/BA crossover design, statistics and confidence limits are displayed for each of the four cells in
the design (all four combinations of the two periods and two treatments). If the IGNOREPERIOD option is
specified in the VAR statement, then results are also displayed for the overall treatment difference or ratio,
the same as they are for the paired design. If the IGNOREPERIOD option is absent, then results are also
displayed for the treatment difference or ratio within each sequence and overall, and also for the period
difference or ratio, the same as they are for the two-sample design.
The Statistics table displays the following summary statistics:
the names of the variables, displayed if the NOBYVAR option is used in the PROC TTEST statement
the name of the classification variable (if the two-independent-sample design is used) or treatment and
period (if the AB/BA crossover design is used)
the Method for estimating standard deviation and standard error for a two-independent-sample de-
sign, either pooled (for the equal-variance assumption) or Satterthwaite (for the unequal-variance
assumption)
the (arithmetic) Mean, displayed if the DIST=NORMAL option is specified in the PROC TTEST
statement
the Geometric Mean, displayed if the DIST=LOGNORMAL option is specified in the PROC TTEST
statement
Std Dev, the standard deviation, displayed if the DIST=NORMAL option is specified in the PROC
TTEST statement
the Coefficient of Variation, displayed if the DIST=LOGNORMAL option is specified in the PROC
TTEST statement
Displayed Output F 10629
Std Err, the standard error of the mean, displayed if the DIST=NORMAL option is specified in the
PROC TTEST statement
the names of the variables, displayed if the NOBYVAR option is used in the PROC TTEST statement
the name of the classification variable (if the two-independent-sample design is used) or treatment and
period (if the AB/BA crossover design is used)
the method for estimating standard deviation and standard error for a two-independent-sample de-
sign, either pooled (for the equal-variance assumption) or Satterthwaite (for the unequal-variance
assumption)
the (arithmetic) Mean, displayed if the DIST=NORMAL option is specified in the PROC TTEST
statement
the Geometric Mean, displayed if the DIST=LOGNORMAL option is specified in the PROC TTEST
statement
100(1 – ˛)% CL Mean, the lower and upper confidence limits for the mean. Separate pooled and
Satterthwaite confidence limits are shown for the difference or ratio transformations in two-independent-
sample designs and AB/BA crossover designs without the IGNOREPERIOD option.
Std Dev, the standard deviation, displayed if the DIST=NORMAL option is specified in the PROC
TTEST statement
the Coefficient of Variation, displayed if the DIST=LOGNORMAL option is specified in the PROC
TTEST statement
100(1 – ˛)% CL Std Dev, the equal-tailed confidence limits for the standard deviation, displayed if the
DIST=NORMAL and CI=EQUAL options are specified in the PROC TTEST statement
100(1 – ˛)% UMPU CL Std Dev, the UMPU confidence limits for the standard deviation, displayed if
the DIST=NORMAL and CI=UMPU options are specified in the PROC TTEST statement
100(1 – ˛)% CL CV, the equal-tailed confidence limits for the coefficient of variation, displayed if the
DIST=LOGNORMAL and CI=EQUAL options are specified in the PROC TTEST statement
100(1 – ˛)% UMPU CL CV, the UMPU confidence limits for the coefficient of variation, displayed if
the DIST=LOGNORMAL and CI=UMPU options are specified in the PROC TTEST statement
The confidence limits in the EquivLimits table and test results in the TTests and EquivTests tables are
displayed only for the test criteria—that is, the variables or transformations being tested. For a one-sample
design, results are displayed for all variables in the analysis. For a paired design, results are displayed for
the difference if you specify the TEST=DIFF option in the PROC TTEST statement, or for the ratio if you
specify TEST=RATIO. For a two-independent-sample design, the results for the difference (if TEST=DIFF)
or ratio (if TEST=RATIO) are displayed. For an AB/BA crossover design, results are displayed for the
10630 F Chapter 128: The TTEST Procedure
treatment difference (if TEST=DIFF) or ratio (if TEST=RATIO). If the IGNOREPERIOD option is absent,
then results are also displayed for the period difference (if TEST=DIFF) or ratio (if TEST=RATIO).
The EquivLimits table, produced only if the TOST option is specified in the PROC TTEST statement, displays
the following:
the name of the variable(s), displayed if the NOBYVAR option is used in the PROC TTEST statement
the (arithmetic) Mean, displayed if the DIST=NORMAL option is specified in the PROC TTEST
statement
the Geometric Mean, displayed if the DIST=LOGNORMAL option is specified in the PROC TTEST
statement
Lower Bound, the lower equivalence bound for the mean specified in the TOST option in the PROC
TTEST statement
100(1 – 2 ˛)% CL Mean, the lower and upper confidence limits for the mean relevant to the equivalence
test. Separate pooled and Satterthwaite confidence limits are shown for two-independent-sample
designs and AB/BA crossover designs without the IGNOREPERIOD option.
Upper Bound, the upper equivalence bound for the mean specified in the TOST option in the PROC
TTEST statement
Assessment, the result of the equivalence test at the significance level specified by the ALPHA= option
in the PROC TTEST statement, either “Equivalent” or “Not equivalent”
The TTests table is produced only if the TOST option is not specified in the PROC TTEST statement.
Separate results for pooled and Satterthwaite tests (and also the Cochran and Cox test, if the COCHRAN
option is specified in the PROC TTEST statement) are displayed for two-independent-sample designs and
AB/BA crossover designs without the IGNOREPERIOD option. The table includes the following results:
the name of the variable(s), displayed if the NOBYVAR option is used in the PROC TTEST statement
t Value, the t statistic for comparing the mean to the null value as specified by the H0= option in the
PROC TTEST statement
the p-value, the probability of obtaining a t statistic at least as extreme as the observed t value under
the null hypothesis
The EquivTests table is produced only if the TOST option is specified in the PROC TTEST statement.
Separate results for pooled and Satterthwaite tests are displayed for two-independent-sample designs and
AB/BA crossover designs without the IGNOREPERIOD option. Each test consists of two separate one-sided
tests. The overall p-value is the larger p-value from these two tests. The table includes the following results:
the name of the variable(s), displayed if the NOBYVAR option is used in the PROC TTEST statement
Null, the lower equivalence bound for the Upper test or the upper equivalence bound for the Lower
test, as specified by the TOST option in the PROC TTEST statement
Displayed Output F 10631
t Value, the t statistic for comparing the mean to the Null value
DF, the degrees of freedom
the p-value, the probability of obtaining a t statistic at least as extreme as the observed t value under
the null hypothesis
The Equality table gives the results of the test of equality of variances. It is displayed for two-independent-
sample designs and AB/BA crossover designs without the IGNOREPERIOD option. The table includes the
following results:
the name of the variable(s), displayed if the NOBYVAR option is used in the PROC TTEST statement
Num DF and Den DF, the numerator and denominator degrees of freedom
F Value, the F 0 (folded) statistic
Pr > F, the probability of a greater F 0 value. This is the two-tailed p-value.
The Bootstrap table displays bootstrap standard error, bias estimates, and confidence limits. These results are
displayed for certain variables in the analysis, their transformations, or their subgroups (or any combination of
these), depending on the design and the analysis options. Results are currently displayed only for one-sample,
paired, and two-sample designs and for analyses that assume normal data and involve means and standard
deviations of either variables or differences between variables or class levels. Bootstrap standard error and
bias estimates are always displayed for these designs and analyses, and Table 128.5 shows which analysis
parameters are supported for each type of bootstrap confidence interval.
Bootstrap results are unavailable if you specify any of the TEST=RATIO, DIST=LOGNORMAL, or TOST
options in the PROC TTEST statement; if you specify the CROSSOVER= option in the VAR statement; or
if you specify the WEIGHT statement. They are also unavailable if your input data set contains summary
statistics rather than raw observed values.
For a one-sample design, results are displayed for all variables. For a paired design, results are displayed for
the paired difference.
For a two-sample design, results are displayed for the class difference—that is, the difference between an
observation from the first class and an observation from the second class. Note in particular that whereas the
limits displayed for standard deviation in the ConfLimits table are for the assumed-common within-class
standard deviation, the limits displayed for standard deviation in the Bootstrap table are forp the standard
deviation of the difference. The estimatedq standard deviation of the difference is equal to 2sp under the
equal-variance assumption and is equal to s12 C s22 under the unequal-variance assumption.
The Bootstrap table includes the following results:
the names of the variables, displayed if the NOBYVAR option is used in the PROC TTEST statement
the name of the classification variable (if the two-independent-sample design is used)
the method for estimating standard deviation for a two-independent-sample design, either pooled (for
the equal-variance assumption) or Satterthwaite (for the unequal-variance assumption); this choice of
method determines both the form of the standard deviation difference estimate on which the bootstrap
standard error and bias estimates are based and also the formulas for some of the confidence limits for
both mean and standard deviation parameters
10632 F Chapter 128: The TTEST Procedure
100(1 – ˛)% CL, the lower and upper bootstrap confidence limits for the relevant transformation of
each parameter, based on the choice of BOOTCI method
ODS Graphics
Statistical procedures use ODS Graphics to create graphs as part of their output. ODS Graphics is described
in detail in Chapter 24, “Statistical Graphics Using ODS.”
Before you create graphs, ODS Graphics must be enabled (for example, by specifying the ODS GRAPH-
ICS ON statement). For more information about enabling and disabling ODS Graphics, see the section
“Enabling and Disabling ODS Graphics” on page 663 in Chapter 24, “Statistical Graphics Using ODS.”
The overall appearance of graphs is controlled by ODS styles. Styles and other aspects of using ODS
Graphics are discussed in the section “A Primer on ODS Statistical Graphics” on page 662 in Chapter 24,
“Statistical Graphics Using ODS.”
ODS Graphics F 10633
Interpreting Graphs
Agreement Plots for Paired Designs
For paired designs, the second response of each pair is plotted against the first response, with the mean
shown as a large bold symbol. If the WEIGHT statement is used, then the mean is the weighted mean. A
diagonal line with a slope of 1 and a y-intercept of 0 is overlaid. The location of the points with respect to the
diagonal line reveals the strength and direction of the difference or ratio. The tighter the clustering along the
same direction as the line, the stronger the positive correlation of the two measurements for each subject.
Clustering along a direction perpendicular to the line indicates negative correlation.
spread of points within each treatment sequence is an indicator of between-subject variability. The tighter the
clustering along the same direction as the line (within each treatment sequence), the stronger the positive
correlation of the two measurements for each subject. Clustering along a direction perpendicular to the line
indicates negative correlation.
Box Plots
The box is drawn from the 25th percentile (lower quartile) to the 75th percentile (upper quartile). The vertical
line inside the box shows the location of the median. If DIST=NORMAL, then a diamond symbol shows the
location of the mean. The whiskers extend to the minimum and maximum observations, and circles beyond
the whiskers identify outliers.
For one-sample and paired designs, a confidence interval for the mean is shown as a band in the background.
If the analysis is an equivalence analysis (with the TOST option in the PROC TTEST statement), then the
interval is a 100(1 – 2 ˛)% confidence interval shown along with the equivalence bounds. The inclusion
of this interval completely within the bounds is indicative of a significant p-value. If the analysis is not an
equivalence analysis, then the confidence level is 100(1 – ˛)%. If the SHOWH0 global plot option is used,
then the null value for the test is shown. If the WEIGHT statement is used, then weights are incorporated in
the confidence intervals.
Histograms
The WEIGHT statement is ignored in the computation of the normal and kernel densities.
Confidence Intervals
If the analysis is an equivalence analysis (with the TOST option in the PROC TTEST statement), then unless
the TYPE=PERGROUP option is used, the interval is a 100(1 – 2 ˛)% mean confidence interval shown along
with the equivalence bounds. The inclusion of this interval completely within the bounds is indicative of a
significant p-value.
If the analysis is not an equivalence analysis, or if the TYPE=PERGROUP option is used, then the confidence
level is 100(1 – ˛)%. If the SHOWH0 global-plot-option is used, then the null value for the test is shown.
If the SIDES=L or SIDES=U option is used in the PROC TTEST statement, then the unbounded side of
the one-sided interval is represented with an arrowhead. Note that the actual location of the arrowhead is
irrelevant.
If the WEIGHT statement is used, then weights are incorporated in the confidence intervals.
In the absence of a strong period effect, the profiles for each sequence will appear as mirror images about
an imaginary horizontal line in the center. Deviations from symmetry about this imaginary horizontal line
indicate a period effect. A wide spread of profiles within sequence indicates high between-subject variability.
The TYPE=PERIOD plot is usually less informative than the TYPE=TREATMENT plot. The exception is
when the period effect is stronger than the treatment effect.
Q-Q Plots
Q-Q plots are useful for diagnosing violations of the normality and homoscedasticity assumptions. If the
data in a Q-Q plot come from a normal distribution, the points will cluster tightly around the reference line.
You can use the UNIVARIATE procedure with the NORMAL option to numerically check the normality
assumption.
data graze;
length GrazeType $ 10;
input GrazeType $ WtGain @@;
datalines;
controlled 45 controlled 62
controlled 96 controlled 128
controlled 120 controlled 99
controlled 28 controlled 50
controlled 109 controlled 115
Example 128.1: Using Summary Statistics to Compare Group Means F 10639
controlled 39 controlled 96
controlled 87 controlled 100
controlled 76 controlled 80
continuous 94 continuous 12
continuous 26 continuous 89
continuous 88 continuous 96
continuous 85 continuous 130
continuous 75 continuous 54
continuous 112 continuous 69
continuous 104 continuous 95
continuous 53 continuous 21
;
The variable GrazeType denotes the grazing method: “controlled” is controlled grazing and “continuous” is
continuous grazing. The dollar sign ($) following GrazeType makes it a character variable, and the trailing at
signs (@@) tell the procedure that there is more than one observation per line.
If you have summary data—that is, just means and standard deviations, as computed by PROC MEANS—
then you can still use PROC TTEST to perform a simple t test analysis. This example demonstrates this
mode of input for PROC TTEST. Note, however, that graphics are unavailable when summary statistics are
used as input.
The MEANS procedure is invoked to create a data set of summary statistics with the following statements:
proc sort;
by GrazeType;
run;
The following statements invoke PROC TTEST with the newgraze data set, as denoted by the DATA= option:
Variable: WtGain
95%
GrazeType Method Mean 95% CL Mean Std Dev CL Std Dev
continuous 75.1875 57.1705 93.2045 33.8117 24.9768 52.3300
controlled 83.1250 66.8541 99.3959 30.5350 22.5563 47.2587
Diff (1-2) Pooled -7.9375 -31.1984 15.3234 32.2150 25.7434 43.0609
Diff (1-2) Satterthwaite -7.9375 -31.2085 15.3335
In Output 128.1.2, The GrazeType column specifies the group for which the statistics are computed. For each
class, the sample size, mean, standard deviation and standard error, and maximum and minimum values are
displayed. The confidence bounds for the mean are also displayed.
Output 128.1.3 shows the results of tests for equal group means and equal variances.
Example 128.2: One-Sample Comparison with the FREQ Statement F 10641
Equality of Variances
Method Num DF Den DF F Value Pr > F
Folded F 15 15 1.23 0.6981
A group test statistic for the equality of means is reported for both equal and unequal variances. Both tests
indicate a lack of evidence for a significant difference between grazing methods (t = –0.70 and p = 0.4912 for
the pooled test, t = –0.70 and p = 0.4913 for the Satterthwaite test). The equality of variances test does not
indicate a significant difference in the two variances .F 0 D 1:23; p D 0:6981/. Note that this test assumes
that the observations in both data sets are normally distributed; this assumption can be checked in PROC
UNIVARIATE by using the NORMAL option with the raw data.
Although the ability to use summary statistics as input is useful if you lack access to the original data, some
of the output that would otherwise be produced in an analysis on the original data is unavailable. There are
also limitations on the designs and distributional assumptions that can be used with summary statistics as
input. For more information, see the section “Input Data Set of Statistics” on page 10606.
data read;
input score count @@;
datalines;
40 2 47 2 52 2 26 1 19 2
25 2 35 4 39 1 26 1 48 1
14 2 22 1 42 1 34 2 33 2
18 1 15 1 29 1 41 2 44 1
51 1 43 1 27 2 46 2 28 1
49 1 31 1 28 1 54 1 45 1
;
The following statements invoke the TTEST procedure to test if the mean test score is equal to 30.
The count variable contains the frequency of occurrence of each test score; this is specified in the FREQ
statement. The output, shown in Output 128.2.1, contains the results.
Variable: score
Frequency: count
95%
Mean 95% CL Mean Std Dev CL Std Dev
34.8636 31.4493 38.2780 11.2303 9.2788 14.2291
The SAS log states that 30 observations and two variables have been read. However, the sample size given in
the TTEST output is N=44. This is due to specifying the count variable in the FREQ statement. The test is
significant (t = 2.87, p = 0.0063) at the 5% level, so you can conclude that the mean test score is different
from 30.
The summary panel in Output 128.2.2 shows a histogram with overlaid normal and kernel densities, a box
plot, and the 95% confidence interval for the mean.
Example 128.2: One-Sample Comparison with the FREQ Statement F 10643
The tight clustering of the points around the diagonal line is consistent with the normality assumption.
You could use the UNIVARIATE procedure with the NORMAL option to numerically check the normality
assumption.
fuel efficiency readings of two fuel types observed on the same automobile
sunburn scores for two sunblock lotions, one applied to the individual’s right arm, one to the left arm
In this example, taken from the SUGI Supplemental Library User’s Guide, Version 5 Edition, a stimulus
is being examined to determine its effect on systolic blood pressure. Twelve men participate in the study.
Each man’s systolic blood pressure is measured both before and after the stimulus is applied. The following
statements input the data:
data pressure;
input SBPbefore SBPafter @@;
datalines;
120 128 124 131 130 131 118 127
140 132 128 125 140 141 135 137
126 118 130 132 126 129 127 135
;
The variables SBPbefore and SBPafter denote the systolic blood pressure before and after the stimulus,
respectively.
The statements to perform the test follow:
proc ttest;
paired SBPbefore*SBPafter;
run;
95%
Mean 95% CL Mean Std Dev CL Std Dev
-1.8333 -5.5365 1.8698 5.8284 4.1288 9.8958
The variables SBPbefore and SBPafter are the paired variables with a sample size of 12. The summary
statistics of the difference are displayed (mean, standard deviation, and standard error) along with their
confidence limits. The minimum and maximum differences are also displayed. The t test is not significant (t
= –1.09, p = 0.2992), indicating that the stimuli did not significantly affect systolic blood pressure.
The summary panel in Output 128.3.2 shows a histogram, normal and kernel densities, box plot, and 100(1 –
˛)% = 95% confidence interval of the SBPbefore – SBPafter difference.
10646 F Chapter 128: The TTEST Procedure
The agreement plot in Output 128.3.3 reveals that only three men have higher blood pressure before the
stimulus than after.
Example 128.3: Paired Comparisons F 10647
But the differences for these men are relatively large, keeping the mean difference only slightly negative.
The profiles plot in Output 128.3.4 is a different view of the same information contained in Output 128.3.3,
plotting the blood pressure from before to after the stimulus.
10648 F Chapter 128: The TTEST Procedure
The Q-Q plot shows no obvious deviations from normality. You can check the assumption of normality more
rigorously by using PROC UNIVARIATE with the NORMAL option.
data asthma;
input Drug1 $ Drug2 $ PEF1 PEF2 @@;
datalines;
for sal 310 270 for sal 310 260 for sal 370 300
for sal 410 390 for sal 250 210 for sal 380 350
for sal 330 365
sal for 370 385 sal for 310 400 sal for 380 410
sal for 290 320 sal for 260 340 sal for 90 220
;
You can display the data by using the following statements, which produce Output 128.4.1:
The variables PEF1 and PEF2 represent the responses for the first and second periods, respectively. The
variables Drug1 and Drug2 represent the treatment in each period.
You can analyze this crossover design by using the CROSSOVER= option after a slash (/) in the VAR
statement:
Crossover Variable
Information
Period Response Treatment
1 PEF1 Drug1
2 PEF2 Drug2
Output 128.4.3 displays basic summary statistics (sample size, mean, standard deviation, standard error,
minimum, and maximum) for each of the four cells in the design, the treatment difference within each
treatment sequence, the overall treatment difference, and the overall period difference.
Sequence Treatment Period Method N Mean Std Dev Std Err Minimum Maximum
1 for 1 7 337.1 53.7631 20.3206 250.0 410.0
2 for 2 6 345.8 70.8814 28.9372 220.0 410.0
2 sal 1 6 283.3 105.4 43.0245 90.0000 380.0
1 sal 2 7 306.4 64.7247 24.4636 210.0 390.0
1 Diff (1-2) 7 30.7143 32.9682 12.4608 -35.0000 70.0000
2 Diff (1-2) 6 62.5000 44.6934 18.2460 15.0000 130.0
Both Diff (1-2) Pooled 46.6071 19.3702 10.7766
Both Diff (1-2) Satterthwaite 46.6071 11.0475
Both Diff (1-2) Pooled -15.8929 19.3702 10.7766
Both Diff (1-2) Satterthwaite -15.8929 11.0475
The treatment difference “Diff (1–2)” corresponds to the “for” treatment minus the “sal” treatment, because
“for” appears before “sal” in the output, according to the ORDER=MIXED default PROC TTEST option. Its
mean estimate is 46.6071, favoring formoterol over salbutamol.
The standard deviation (Std Dev) reported for a “difference” is actually the pooled standard deviation across
both treatment sequence (for/sal and sal/for), assuming equal variances. The standard error (Std Err) is the
standard deviation of the mean estimate.
The top half of the table in Output 128.4.4 shows 95% two-sided confidence limits for the means for the
same criteria addressed in the table in Output 128.4.3.
10652 F Chapter 128: The TTEST Procedure
95%
Sequence Treatment Period Method Mean 95% CL Mean Std Dev CL Std Dev
1 for 1 337.1 287.4 386.9 53.7631 34.6446 118.4
2 for 2 345.8 271.4 420.2 70.8814 44.2447 173.8
2 sal 1 283.3 172.7 393.9 105.4 65.7841 258.5
1 sal 2 306.4 246.6 366.3 64.7247 41.7082 142.5
1 Diff (1-2) 30.7143 0.2238 61.2048 32.9682 21.2445 72.5982
2 Diff (1-2) 62.5000 15.5972 109.4 44.6934 27.8980 109.6
Both Diff (1-2) Pooled 46.6071 22.8881 70.3262 19.3702 13.7217 32.8882
Both Diff (1-2) Satterthwaite 46.6071 21.6585 71.5558
Both Diff (1-2) Pooled -15.8929 -39.6119 7.8262 19.3702 13.7217 32.8882
Both Diff (1-2) Satterthwaite -15.8929 -40.8415 9.0558
For the mean differences, both pooled (assuming equal variances for both treatment sequences) and Satterth-
waite (assuming unequal variances) intervals are shown. For example, the pooled confidence limits for the
overall treatment mean difference (for – sal) assuming equal variances are 22.8881 and 70.3262.
The bottom half of Output 128.4.4 shows 95% equal-tailed confidence limits for the standard deviations
within each cell and for the treatment difference within each sequence. It also shows confidence limits for the
pooled common standard deviation assuming equal variances. Note that the pooled standard deviation of
19.3702 and associated confidence limits 13.7217 and 32.8882 apply to both difference tests (treatment and
period), since each of those tests involves the same pooled standard deviation.
Output 128.4.5 shows the results of t tests of treatment and period differences.
Both pooled and Satterthwaite versions of the test of treatment difference are highly significant (p = 0.0012
and p = 0.0022), and both versions of the test of period difference are insignificant (p = 0.1683 and p =
0.1838).
The folded F test of equal variances in each treatment sequence is shown in Output 128.4.6.
Equality of Variances
Method Num DF Den DF F Value Pr > F
Folded F 5 6 1.84 0.4797
The insignificant result (p = 0.48) implies a lack of evidence for unequal variances. However, it does not
demonstrate equal variances, and it is not very robust to deviations from normality.
Output 128.4.7 shows the distribution of the response variables PEF1 and PEF2 within each of the four cells
Example 128.4: AB/BA Crossover Design F 10653
(combinations of two treatments and two periods) of the AB/BA crossover design, in terms of histograms
and normal and kernel density estimates.
The distributions for the first treatment sequence (for/sal) appear to be somewhat symmetric, and the
distributions for the sal/for sequence appear to be skewed to the left.
Output 128.4.8 shows a similar distributional summary but in terms of box plots.
10654 F Chapter 128: The TTEST Procedure
The relative locations of means and medians in each box plot corroborate the fact that the distributions for
the sal/for sequence are skewed to the left. The distributions for the for/sal sequence appear to be skewed
slightly to the right. The box plot for the salbutamol treatment in the first period shows an outlier (the circle
on the far left side of the plot).
The treatment agreement plot in Output 128.4.9 reveals that only a single observation has a higher peak
expiratory flow for salbutamol.
Example 128.4: AB/BA Crossover Design F 10655
The mean for the sal/for treatment sequence is farther from the diagonal equivalence line, revealing that
the treatment difference is more pronounced for the 6 observations in the sal/for sequence than for the 7
observations in the for/sal sequence. This fact is also seen numerically in Output 128.4.3 and Output 128.4.4,
which show within-sequence treatment differences of 30.7 for for/sal and 62.5 for sal/for.
The profiles over treatment plot in Output 128.4.10 is a different view of the same information contained
in Output 128.4.9, plotting the profiles from formoterol to salbutamol treatments. The lone observation for
which the peak expiratory flow is higher for salbutamol appears as the only line with negative slope.
10656 F Chapter 128: The TTEST Procedure
The Q-Q plots in Output 128.4.11 assess normality assumption within each of the four cells of the design.
Example 128.4: AB/BA Crossover Design F 10657
The two Q-Q plots for the sal/for sequence (lower left and upper right) suggest some possible normality
violations in the tails, but the sample size is too small to make any strong conclusions. You could use the
UNIVARIATE procedure with the NORMAL option to numerically check the normality assumptions.
Finally, Output 128.4.12 shows both pooled and Satterthwaite two-sided 95% confidence intervals for the
treatment difference.
10658 F Chapter 128: The TTEST Procedure
The pooled interval is slightly smaller than the Satterthwaite interval. (This is not always the case.)
data auc;
input TestAUC RefAUC @@;
datalines;
103.4 90.11 59.92 77.71 68.17 77.71 94.54 97.51
69.48 58.21 72.17 101.3 74.37 79.84 84.44 96.06
96.74 89.30 94.26 97.22 48.52 61.62 95.68 85.80
;
You can display the data by using the following statements, which produce Output 128.5.1:
Example 128.5: Equivalence Testing with Lognormal Data F 10659
The TestAUC and RefAUC variables represent the AUC measurements for each subject under the Test and
Reference drugs, respectively. Use the following SAS statements to perform the equivalence analysis:
Geometric Coefficient
N Mean of Variation Minimum Maximum
12 0.9412 0.1676 0.7124 1.1936
The geometric mean ratio of 0.9412 is the sample mean of the log-transformed data exponentiated to bring it
back to the original scale. So the plasma concentration over the 20-hour period is slightly lower for the Test
drug than for the Reference drug. The CV of 0.1676 is the ratio of the standard deviation to the (arithmetic)
mean.
Output 128.5.3 shows the 100(1 – ˛)% = 95% confidence limits for the geometric mean ratio (0.8467 and
10660 F Chapter 128: The TTEST Procedure
Geometric Coefficient
Mean 95% CL Mean of Variation 95% CL CV
0.9412 0.8467 1.0462 0.1676 0.1183 0.2884
Output 128.5.4 shows the 100(1 – 2 ˛)% = 90% confidence limits for the geometric mean ratio, 0.8634 and
1.0260.
Output 128.5.4 Equivalence Limits
The assessment of “Equivalent” reflects the fact that these limits are contained within the equivalence bounds
0.8 and 1.25. This result occurs if and only if the p-value of the test is less than the ˛ value specified in the
ALPHA= option in the PROC TTEST statement, and it is the reason that 100(1 – 2 ˛)% confidence limits are
shown in addition to the usual 100(1 – ˛)% limits.
Output 128.5.5 shows the p-values for the two one-sided tests against the upper and lower equivalence
bounds.
Output 128.5.5 TOST Equivalence Test
The overall p-value of 0.0031, the larger of the two one-sided p-values, indicates significant evidence of
equivalence between the Test and Reference drugs.
The summary panel in Output 128.5.6 shows a histogram, kernel density, box plot, and 100(1 – 2 ˛)% = 90%
confidence interval of the Test-to-Reference ratio of AUC, along with the equivalence bounds.
Example 128.5: Equivalence Testing with Lognormal Data F 10661
The confidence interval is closer to the lower equivalence bound than the upper bound and contained entirely
within the bounds.
The agreement plot in Output 128.5.7 reveals that the only four subjects with higher AUC for the Test drug
are at the far lower or far upper end of the AUC distribution. This might merit further investigation.
10662 F Chapter 128: The TTEST Procedure
The profiles plot in Output 128.5.8 is a different view of the same information contained in Output 128.5.7,
plotting the AUC from Test to Reference drug.
Example 128.6: Bootstrap with Two-Sample Design F 10663
data scores;
input Gender $ Score @@;
datalines;
f 75 f 76 f 80 f 77 f 80 f 77 f 73
m 82 m 80 m 85 m 85 m 78 m 87 m 82
;
10664 F Chapter 128: The TTEST Procedure
The addition of the BOOTSTRAP statement to the SAS statements specified in the section “Comparing
Group Means” on page 10587 requests bootstrap results for the comparison of female and male golf scores,
as follows:
Variable: Score
Let yf and ym denote the random variables for female and male scores, respectively. The mean of –5.8571
in Output 128.6.1 is computed as yNf yNm , the estimated mean of the difference yf ym . The standard
deviation of 2.8619 is the pooled estimate of the standard deviation of either yf or ym , which are assumed in
the pooled method to have equal variances. The standard error of 1.5298 is the estimated standard deviation
of yNf yNm . This standard error is identical for both pooled and Satterthwaite methods because the group
sample sizes are equal (nf D nm ).
Output 128.6.2 displays both pooled and Satterthwaite 95% intervals for the mean of the difference yf ym .
It also shows equal-tailed and uniformly most powerful unbiased confidence limits for the assumed-common
standard deviation of yf and ym under the assumption of equal variances.
Example 128.6: Bootstrap with Two-Sample Design F 10665
95%
95% UMPU CL Std
Gender Method Mean 95% CL Mean Std Dev CL Std Dev Dev
f 76.8571 74.5036 79.2107 2.5448 1.6399 5.6039 1.5634 5.2219
m 82.7143 79.8036 85.6249 3.1472 2.0280 6.9303 1.9335 6.4579
Diff (1-2) Pooled -5.8571 -9.1902 -2.5241 2.8619 2.0522 4.7242 2.0019 4.5727
Diff (1-2) Satterthwaite -5.8571 -9.2064 -2.5078
Output 128.6.3 shows the bootstrap results for the golf score data.
Each of the 10,000 bootstrap samples in the bootstrap analysis consists of a collection of nf D 7 random
draws with replacement from the female scores and nm D 7 random draws with replacement from the male
scores. For each of these samples, three statistics are computed:
It is these three statistics that correspond to the three rows in Output 128.6.3, identified by the Method and
Parameter columns.
The bootstrap estimate of the standard error of the mean difference, 1.4184, is slightly lower than the estimate
of 1.5298 from the original sample. The bootstrap estimate of the bias of yN1 yN2 is 0.0044, very small
compared to either estimate of the standard error.
There is only one row for the mean difference parameter in Output 128.6.3 because the bias-corrected
percentile interval is invariant to the choice between pooled and Satterthwaite methods for estimating
the standard deviation. The 95% bootstrap bias-corrected confidence interval for the mean difference is
substantially narrower than either of the t-based confidence intervals shown in Output 128.6.2. This is not too
surprising because the bootstrap bias-corrected interval corrects only for median bias—that is, a difference
between the parameter and the median of its distribution—and not for narrowness bias. Narrowness bias
in this context is the tendency of uncorrected bootstrap percentile intervals to be too narrow, especially for
small sample sizes such as in this case (nf D nm D 7).
The second and third rows in Output 128.6.3 show bootstrap results for the pooled and Satterthwaite estimates,
respectively, of the standard deviation of yf ym . These estimates are identical to each other—both in the
original sample and in the bootstrap results—because the group sample sizes are equal. The bootstrap standard
error estimate, 0.5776, has no straightforward basis for comparison among the estimates that are computed
10666 F Chapter 128: The TTEST Procedure
directly from the original sample in Output 128.6.1 and Output 128.6.2 because there is no reasonable
closed-form estimate for the standard deviation of a standard deviation estimate. This demonstrates one of
the advantages of the bootstrap—that it can produce standard error estimates for any statistical estimator.
The estimated bias of the standard deviation of the difference is relatively large compared to the standard
error and implies that the standard deviation of yf ym is being underestimated in the original sample.
The bootstrap bias-corrected percentile interval for the standard deviation of yf ym , (3.2071, 5.2372),
cannot be directly compared with the estimate and confidence limits of the pooled standard deviation that
are computed from the original sample in Output 128.6.2. However, you can transform the statistics for
the pooledp standard deviation into statistics for the standard deviation of yf ym simply by multiplying
them by 2, because the pooled estimate of Var.yf ym / is 2sp2 . The resulting point estimate from the
p
original sample is 2.8619 2 = 4.0473. The transformed equal-tail and UMPU confidence intervals are,
respectively, (2.9022, 6.6810) and (2.8311, 6.4668).
The bootstrap summary panels in Output 128.6.4 through Output 128.6.6 show histograms, normal and
kernel densities, box plots, and 100(1 – ˛)% = 95% bootstrap bias-corrected percentile intervals for the mean,
pooled standard deviation, and Satterthwaite standard deviation of the difference between female and male
scores.
Output 128.6.4 Summary Panel of Bootstrap Mean
Example 128.6: Bootstrap with Two-Sample Design F 10667
The bootstrap Q-Q plots in Output 128.6.7 through Output 128.6.9 assess the normality of the distributions of
the bootstrap mean, pooled standard deviation, and Satterthwaite standard deviation of the difference between
female and male scores. The deviations from normality in the upper tail of the standard deviations are not
surprising, because they have approximate chi-square distributions for normal data.
Example 128.6: Bootstrap with Two-Sample Design F 10669
The bootstrap correlation plots in Output 128.6.10 and Output 128.6.11 show the relationship between the
bootstrap mean and the bootstrap pooled and Satterthwaite standard deviations of the difference between
female and male scores. The approximately circular (as opposed to elongated elliptical) shapes of the
prediction regions suggest unusually low correlations between the mean and standard deviation.
10672 F Chapter 128: The TTEST Procedure
Output 128.6.10 Correlation Plot of Bootstrap Mean and Pooled Standard Deviation
Example 128.6: Bootstrap with Two-Sample Design F 10673
Output 128.6.11 Correlation Plot of Bootstrap Mean and Satterthwaite Standard Deviation
The bootstrap interval plots in Output 128.6.12 and Output 128.6.13 show 100(1 – ˛)% = 95% bootstrap bias-
corrected percentile intervals of the mean, pooled standard deviation, and Satterthwaite standard deviation of
the difference between female and male scores. The distance and direction between the sample and bootstrap
means that are marked on the interval for each statistic reflect the size and sign of the bootstrap-estimated
bias of the sample mean of the statistic.
10674 F Chapter 128: The TTEST Procedure
Output 128.6.13 Bootstrap Bias-Corrected Percentile Interval Plot of Pooled and Satterthwaite Standard
Deviations
For the purpose of illustration, it is informative to compare the bootstrap bias-corrected percentile intervals
to both unadjusted and expanded percentile intervals. The following SAS statements request unadjusted
bootstrap percentile intervals:
run;
Output 128.6.14 through Output 128.6.16 show very similar confidence limits for the mean difference but
substantially lower limits for the standard deviation of the difference, compared to the bootstrap bias-corrected
confidence limits in Output 128.6.3, Output 128.6.12, and Output 128.6.13. This is consistent with both the
magnitudes and directions of the bootstrap bias estimates. The minor differences in the bootstrap standard
error and bias estimates between Output 128.6.3 and Output 128.6.14 are due only to random variation in the
bootstrap resampling.
Variable: Score
Output 128.6.16 Bootstrap Percentile Interval Plot of Pooled and Satterthwaite Standard Deviations
Variable: Score
There are distinct pooled and Satterthwaite versions of the expanded percentile intervals for the mean in
Output 128.6.17 and Output 128.6.18, because the two methods compute degrees of freedom differently and
the degrees of freedom are involved in the “expanded” adjustment.
Expanded percentile intervals are not computed for the standard deviation parameters because the method that
is specified in the BOOTCI=EXPANDEDPERC option is based on the assumption of approximate normality
O However, both the pooled and Satterthwaite standard deviation estimates have
of the bootstrapped statistic .
approximate chi-square distributions under normality. Because they are not sample mean estimates, they are
not subject to the central limit theorem.
References
Best, D. I., and Rayner, C. W. (1987). “Welch’s Approximate Solution for the Behrens-Fisher Problem.”
Technometrics 29:205–210.
Carpenter, J., and Bithell, J. (2000). “Bootstrap Confidence Intervals: When, Which, What? A Practical
Guide for Medical Statisticians.” Statistics in Medicine 19:1141–1164.
Chow, S.-C., and Liu, J.-P. (2000). Design and Analysis of Bioavailability and Bioequivalence Studies. 2nd
ed. New York: Marcel Dekker.
Cochran, W. G., and Cox, G. M. (1950). Experimental Designs. New York: John Wiley & Sons.
Dilba, G., Schaarschmidt, F., and Hothorn, L. A. (2007). “Inferences for Ratios of Normal Means.” R News
7:20–23.
Diletti, D., Hauschke, D., and Steinijans, V. W. (1991). “Sample Size Determination for Bioequivalence
Assessment by Means of Confidence Intervals.” International Journal of Clinical Pharmacology, Therapy,
and Toxicology 29:1–8.
10678 F Chapter 128: The TTEST Procedure
Efron, B., and Tibshirani, R. J. (1993). An Introduction to the Bootstrap. New York: Chapman & Hall.
Fieller, E. C. (1954). “Some Problems in Interval Estimation.” Journal of the Royal Statistical Society, Series
B 16:175–185.
Hauschke, D., Kieser, M., Diletti, E., and Burke, M. (1999). “Sample Size Determination for Proving
Equivalence Based on the Ratio of Two Means for Normally Distributed Data.” Statistics in Medicine
18:93–105.
Hesterberg, T. C. (2015). “What Teachers Should Know about the Bootstrap: Resampling in the Undergradu-
ate Statistics Curriculum.” American Statistician 69:371–386.
Huntsberger, D. V., and Billingsley, P. (1989). Elements of Statistical Inference. Dubuque, IA: Wm. C.
Brown.
Johnson, N. L., Kotz, S., and Balakrishnan, N. (1994). Continuous Univariate Distributions. 2nd ed. Vol. 1.
New York: John Wiley & Sons.
Jones, B., and Kenward, M. G. (2003). Design and Analysis of Cross-Over Trials. 2nd ed. Boca Raton, FL:
Chapman & Hall/CRC.
Lee, A. F. S., and Gurland, J. (1975). “Size and Power of Tests for Equality of Means of Two Normal
Populations with Unequal Variances.” Journal of the American Statistical Association 70:933–941.
Lehmann, E. L. (1986). Testing Statistical Hypotheses. New York: John Wiley & Sons.
Phillips, K. F. (1990). “Power of the Two One-Sided Tests Procedure in Bioequivalence.” Journal of
Pharmacokinetics and Biopharmaceutics 18:137–144.
Politis, D. (2016). “t and 2 : Revisiting the Classical Tests for the 21st Century Classroom.” IMS Bulletin
45:10–11.
Posten, H. O., Yeh, Y. Y., and Owen, D. B. (1982). “Robustness of the Two-Sample t Test under Violations
of the Homogeneity of Variance Assumption.” Communications in Statistics—Theory and Methods
11:109–126.
Ramsey, P. H. (1980). “Exact Type I Error Rates for Robustness of Student’s t Test with Unequal Variances.”
Journal of Educational Statistics 5:337–349.
Robinson, G. K. (1976). “Properties of Student’s t and of the Behrens-Fisher Solution to the Two Mean
Problem.” Annals of Statistics 4:963–971.
SAS Institute Inc. (1986). SUGI Supplemental Library User’s Guide, Version 5 Edition. Cary, NC: SAS
Institute Inc.
Sasabuchi, S. (1988a). “A Multivariate Test with Composite Hypotheses Determined by Linear Inequalities
When the Covariance Matrix Has an Unknown Scale Factor.” Memoirs of the Faculty of Science, Kyushu
University, Series A 42:9–19.
Sasabuchi, S. (1988b). “A Multivariate Test with Composite Hypotheses When the Covariance Matrix Is
Completely Unknown.” Memoirs of the Faculty of Science, Kyushu University, Series A 42:37–46.
References F 10679
Scheffé, H. (1970). “Practical Solutions of the Behrens-Fisher Problem.” Journal of the American Statistical
Association 65:1501–1508.
Schuirmann, D. J. (1987). “A Comparison of the Two One-Sided Tests Procedure and the Power Approach for
Assessing the Equivalence of Average Bioavailability.” Journal of Pharmacokinetics and Biopharmaceutics
15:657–680.
Senn, S. (2002). Cross-Over Trials in Clinical Research. 2nd ed. New York: John Wiley & Sons.
Steel, R. G. D., and Torrie, J. H. (1980). Principles and Procedures of Statistics. 2nd ed. New York:
McGraw-Hill.
Tamhane, A. C., and Logan, B. R. (2004). “Finding the Maximum Safe Dose Level for Heteroscedastic Data.”
Journal of Biopharmaceutical Statistics 14:843–856.
Wang, Y. Y. (1971). “Probabilities of the Type I Error of the Welch Tests for the Behrens-Fisher Problem.”
Journal of the American Statistical Association 66:605–608.
Wellek, S. (2003). Testing Statistical Hypotheses of Equivalence. Boca Raton, FL: Chapman & Hall/CRC.
Yuen, K. K. (1974). “The Two-Sample Trimmed t for Unequal Population Variances.” Biometrika 61:165–
170.