This function computes the test and key test quantities for the two one-sided test for equivalence, as documented in Schuirmann (1981) and Westlake (1981). The function computes the test for a sample of paired differences or two samples, assumed to be from a normally-distributed population.
Much code in the function has been copied and adapted from R's t.test.default function.
tost(x, y = NULL, epsilon = 1, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, alpha = NULL,
...)
A list with the following components
the mean of the difference
the standard error of the difference
the size of the test
a character string giving the name(s) of the data
the 1-alpha confidence interval for the difference
the degrees of freedom used for the confidence interval
the magnitude of the region of similarity
the outcome of the test of the null hypothesis of dissimilarity
a character string indicating what type of t-test was performed
the specified hypothesized value of the mean or mean difference depending on whether it was a one-sample tost or a two-sample tost.
the p-value of the tost significance test
the two one-sided confidence interval corresponding to the test.
the first (or only) sample
the second sample
magnitude of region of similarity
a logical indicating whether you want a paired tost
a logical variable indicating whether to treat the two variances as being equal. If 'TRUE' then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used.
confidence level of the interval
test size (for backwards-compatibility, overrides conf.level)
arguments to be passed to other functions.
Andrew Robinson A.Robinson@ms.unimelb.edu.au
The function inherits infrastructure from R's t.test.default, so a number of elements have been copied from the help file of that function.
This test requires the assumption of normality of the population, or an invocation of large-sample theory. The function wraps around the t.test function, so it provides tosts for the same range of designs, accepts the same arguments, and handles missing values the same way.
If 'paired' is 'TRUE' then both 'x' and 'y' must be specified and they must be the same length. Missing values are silently removed (in pairs if 'paired' is 'TRUE'). If 'var.equal' is 'TRUE' then the pooled estimate of the variance is used. By default, if 'var.equal' is 'FALSE' then the variance is estimated separately for both groups and the Welch modification to the degrees of freedom is used.
Schuirmann, D.L. 1981. On hypothesis testing to determine if the mean of a normal distribution is contained in a known interval. Biometrics 37 617.
Robinson, A.P., and R.E. Froese. 2004. Model validation using equivalence tests. Ecological Modelling 176, 349--358.
Wellek, S. 2003. Testing statistical hypotheses of equivalence. Chapman and Hall/CRC. 284 pp.
Westlake, W.J. 1981. Response to T.B.L. Kirkwood: bioequivalence testing - a need to rethink. Biometrics 37, 589-594.
tost.stat
, ptte.data
data(ufc)
tost(ufc$Height.m.p, ufc$Height.m, epsilon = 1, paired = TRUE)
Run the code above in your browser using DataLab