*! version 3.1.4 09oct2023
help tostt

Title

tostt -- Mean-equivalence t tests

Syntax

One-sample mean-equivalence t test

tostt varname == # [if] [in]
[, eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
alpha(#)
relevance]

Two-sample unpaired mean-equivalence t test

tostt 1 == 2 [if] [in]
, unpaired
[eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
unequal
welch
alpha(#)
relevance]

Two-sample paired mean-equivalence t test

tostt 1 == 2 [if] [in]
[, eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
alpha(#)
relevance]

Two-group unpaired mean-equivalence t test

tostt varname [if] [in]
, by(varlist:groupvar)
[eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
unequal
welch
alpha(#)
relevance]

Immediate form of one-sample mean-equivalence t test

tostti
#obs
#mean
#sd
#val
[, eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
xname(string)
alpha(#)
relevance]

Immediate form of two-sample mean-equivalence t test

tostti
#obs1
#mean1
#sd1
#obs2
#mean2
#sd2
[, eqvtype(type)
eqvlevel(#)
uppereqvlevel(#)
unequal
welch
xname(string)
yname(string)
alpha(#)
relevance]

Miscellaneous
eqvtype(string) specify equivalence threshold with Delta or epsilon

eqvlevel(#) the level of tolerance defining the equivalence interval

uppereqvlevel(#) the upper value of an asymmetric equivalence interval

unpaired the data are unpaired

by(varlist:groupvar) variable defining the two groups (implies unpaired)

unequal unpaired data have unequal variances

welch use Welch's approximation (implies unequal)

xname(string) the name of the first variable

yname(string) the name of the second variable

alpha(#) set nominal type I level; default is alpha(0.05)

relevance perform & report combined tests for difference and equivalence

Description

tostt tests for the equivalence of means within a symmetric equivalence
interval defined by eqvtype and eqvlevel using a two one-sided t
tests approach (Schuirmann, 1987). Typically null
hypotheses are framed from an assumption of a lack of difference between two
quantities, and reject this assumption only with sufficient evidence. When
performing tests for equivalence, one frames a null hypothesis with the
assumption that two quantities are different within an equivalence interval
defined by some chosen level of tolerance (as specified by eqvtype and
eqvlevel).

With respect to an unpaired t test, an equivalence null hypothesis takes one of
the following two forms depending on whether equivalence is defined in terms of
Delta (equivalence expressed in the same units as the x and y) or in terms of
epsilon (equivalence expressed in the units of the T distribution with the
given degrees of freedom):

Ho: |mean(x) - mean(y)| >= Delta,

where the equivalence interval ranges from diff-Delta to diff+Delta, and
where diff is either the mean difference or the difference in means depending on
whether the test is paired or unpaired. This translates directly into two
one-sided null hypotheses:

Ho1: Delta - [mean(x) - mean(y)] <= 0; and

Ho2: [mean(x) - mean(y)] + Delta <= 0

-OR-

Ho: |T| >= epsilon,

where the equivalence interval ranges from -epsilon to epsilon. This also
translates directly into two one-sided null hypotheses:

Ho1: epsilon - T <= 0; and

Ho2: T + epsilon <= 0

When an asymmetric equivalence interval is defined using the uppereqvlevel option
the general negativist null hypothesis becomes:

Ho: [mean(x) - mean(y)] <= Delta_lower, or [mean(x) - mean(y)] >= Delta_upper,

where the equivalence interval ranges from [mean(x) - mean(y)] + Delta_lower to
[mean(x) - mean(y)] + Delta_upper. This also translates directly into two
one-sided null hypotheses:

Ho1: Delta_upper - [mean(x) - mean(y)] <= 0; and

Ho2: [mean(x) - mean(y)] - Delta_lower <= 0

-OR-

Ho: T <= epsilon_lower, or T >= epsilon_upper,

Ho1: epsilon_upper - T <= 0; and

Ho2: T - epsilon_lower <= 0

NOTE: the appropriate level of alpha is precisely the same as in the
corresponding two-sided test of mean difference, so that, for example, if one
wishes to make a type I error %5 of the time, one simply conducts both of the
one-sided tests of Ho1 and Ho2 by comparing the resulting p-value to 0.05
(Tryon and Lewis, 2008).

Options

Main

eqvtype(string) defines whether the equivalence interval will be
defined in terms of Delta or epsilon (delta, or epsilon). These
options change the way that evqlevel is interpreted: when delta is
specified, the evqlevel is measured in the units of the variable being
tested, and when epsilon is specified, the evqlevel is measured in
multiples of the standard deviation of the T distribution; put another way
epsilon = Delta/standard error. The default is delta.

Defining tolerance in terms of epsilon means that it is not possible to reject
any test of mean equivalence Ho if epsilon <= the critical value of t for a
given alpha and degrees of freedom. Because epsilon = Delta/standard error, we
can see that it is not possible to reject any Ho if Delta <= the product of the
standard error and critical value of t for a given alpha and degrees of freedom.
tostt and tostti now report when either of these conditions obtain.

eqvlevel(#) defines the equivalence threshold for the tests depending on
whether eqvtype is delta or epsilon (see above). Researchers
are responsible for choosing meaningful values of Delta or epsilon. The default
value is 1 when delta is the eqvtype and 2 when epsilon is the eqvtype.

uppereqvlevel(#) defines the upper equivalence threshold for the test,
and transforms the meaning of eqvlevel to mean the lower equivalence
threshold for the test. Also, eqvlevel is assumed to be a negative value.
Taken together, these correspond to Schuirmann's (1987)
asymmetric equivalence intervals. If uppereqvlevel==|eqvlevel|, then
uppereqvlevel will be ignored.

by(varlist:groupvar) specifies the groupvar that defines the two
groups that tostt will use to test the hypothesis that their means are
different. Specifying by(groupvar) implies an unpaired (two sample) t
test. Do not confuse the by() option with the by prefix; you can
specify both.

unpaired specifies that the data be treated as unpaired. The
unpaired option is used when the two set of values to be compared are
in different variables.

unequal specifies that the unpaired data not be assumed to have equal
variances.

welch specifies that the approximate degrees of freedom for the test
be obtained from Welch's formula (1947) rather than
Satterthwaite's approximation formula (1946),
which is the default when unequal is specified. Specifying welch
implies unequal.

xname(string) specifies how the first variable will be labeled in the
output. The default value of xname is x.

yname(string) specifies how the second variable will be labeled in the
output. The default value of yname is y.

alpha(#) specifies the nominal type I error rate. The default is alpha(0.05).

relevance reports results and inference for combined tests for difference
and equivalence for a specific alpha, eqvtype, and eqvlevel.
See the Remarks section more details on inference from combined tests.

Remarks

As described by Tryon and Lewis (2008), when both tests
for difference and equivalence are taken together, there are four possible
interpretations:

1. One may reject the null hypothesis of no difference, but fail to reject the
null hypothesis of difference, and conclude that there is a relevant difference
in means at least as large as Delta or epsilon.

2. One may fail to reject the null hypothesis of no difference, but reject the
null hypothesis of difference, and conclude that the means are equivalent
within the equivalence range (i.e. defined by Delta or epsilon).

3. One may reject both the null hypothesis of no difference and the null
hypothesis of difference, and conclude that the means are trivially different,
within the equivalence range (i.e. defined by Delta or epsilon).

4. One may fail to reject both the null hypothesis of no difference and the
null hypothesis of difference, and draw an indeterminate conclusion, because
the data are underpowered to detect difference or equivalence.

Examples

These examples correspond to those written in the help file for
ttest:

. sysuse auto (setup)
. tostt mpg==20, eqvt(delta) eqvl(2.5) upper(3) (one-sample mean-equivalence test)

. webuse fuel (setup)
. tostt mpg1==mpg2, eqvt(epsilon) eqvl(3) rel (two-sample paired mean relevance test)

. webuse fuel3 (setup)
. tostt mpg, by(treated) eqvt(delta) eqvl(1.5) (two-group unpaired mean-comparison test)
(note warning about value of Delta!)

(no setup required)
. tostti 24 62.6 15.8 75, rel (immediate form; n=24, m=62.6, sd=15.8;
test m=75)

Saved results

The one-sample form of tostt saves the following in
r():

Scalars

r(sd_1) standard deviation for the variable

r(se) estimate of standard error

r(p2) P(T >= t2); upper one-sided p-value under Ho2

r(p1) P(T >= t1); upper one-sided p-value under Ho1

r(t2) t statistic under Ho2

r(t1) t statistic under Ho1

r(df_t) degrees of freedom

r(mu_1) x_1 bar, mean for the population

r(N_1) sample size n_1

r(Delta) Delta, tolerance level defining the equivalence interval; OR

r(Du) Delta_upper, tolerance level defining the equivalence interval's upper side; AND

r(Dl) Delta_lower, tolerance level defining the equivalence interval's lower side; OR

r(epsilon) epsilon, tolerance level defining the equivalence interval

r(eu) epsilon_upper, tolerance level defining the equivalence interval's upper side; AND

r(el) epsilon_lower, tolerance level defining the equivalence interval's lower side

r(relevance) Relevance test conclusion for given alpha and Delta/epsilon

The two-sample and two-group forms of tostt save the following in
r():

Scalars

r(sd_2) standard deviation for second variable

r(sd_1) standard deviation for first variable

r(se) estimate of standard error

r(p2) P(T >= t2); upper one-sided p-value under Ho2

r(p1) P(T >= t1); upper one-sided p-value under Ho1

r(t2) t statistic under Ho2

r(t1) t statistic under Ho1

r(df_t) degrees of freedom

r(mu_2) x_2 bar, mean for population 2

r(N_2) sample size n_2

r(mu_1) x_1 bar, mean for population 1

r(N_1) sample size n_1

r(Delta) Delta, tolerance level defining the equivalence interval; OR

r(Du) Delta_upper, tolerance level defining the equivalence interval's upper side; AND

r(Dl) Delta_lower, tolerance level defining the equivalence interval's lower side; OR

r(epsilon) epsilon, tolerance level defining the equivalence interval

r(eu) epsilon_upper, tolerance level defining the equivalence interval's upper side; AND

r(el) epsilon_lower, tolerance level defining the equivalence interval's lower side

r(relevance) Relevance test conclusion for given alpha and Delta/epsilon

Author

Alexis Dinno

Portland State University

alexis.dinno@pdx.edu

Development of tost is
ongoing, please contact me with any questions, bug reports or suggestions for
improvement. Fixing bugs will be facilitated by sending along:

(1) a copy of the data (de-labeled or anonymized is fine),

(2) a copy of the command used, and

(3) a copy of the exact output of the command.

I am endebted to my winter 2013 students for their inspiration.

Suggested citation

Dinno A. 2017. tostt: Mean-equivalence t tests. Stata software
package. URL:

References

Satterthwaite, F. E. 1946. An approximate distribution of estimates of variance components. Biometrics Bulletin 2: 110-114.

Schuirmann, D. A. 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

Tryon, W. W., and C. Lewis. 2008.
An inferential confidence interval method of establishing statistical equivalence that corrects Tryon’s (2001) reduction factor. Psychological Methods. 13: 272-277

Welch, B. L. 1947. The generalization of “Student’s” problem when several different population variances are involved. Biometrika 34: 28-35.

Also See

Help: tost, pkequiv, ttest