tost {equivalence}R Documentation

Computes a TOST for equivalence from paired or unpaired data

Description

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.

Usage

tost(x, y = NULL, epsilon = 1, paired = FALSE, var.equal = FALSE,
              conf.level = 0.95, alpha = NULL,
    ...)

Arguments

x

the first (or only) sample

y

the second sample

epsilon

magnitude of region of similarity

paired

a logical indicating whether you want a paired tost

var.equal

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.

conf.level

confidence level of the interval

alpha

test size (for backwards-compatibility, overrides conf.level)

...

arguments to be passed to other functions.

Details

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.

Value

A list with the following components

estimate

the mean of the difference

se.diff

the standard error of the difference

alpha

the size of the test

data.name

a character string giving the name(s) of the data

ci.diff

the 1-alpha confidence interval for the difference

parameter

the degrees of freedom used for the confidence interval

epsilon

the magnitude of the region of similarity

result

the outcome of the test of the null hypothesis of dissimilarity

method

a character string indicating what type of t-test was performed

null.value

the specified hypothesized value of the mean or mean difference depending on whether it was a one-sample tost or a two-sample tost.

tost.p.value

the p-value of the tost significance test

tost.interval

the two one-sided confidence interval corresponding to the test.

Note

This test requires the assumption of normality of the population. The components of the test are t-based confidence intervals, so the Central Limit Theorem and Slutsky's Theorem may be relevant to its application in large samples.

Author(s)

Andrew Robinson A.Robinson@ms.unimelb.edu.au

References

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.

See Also

tost.stat, ptte.data

Examples

data(ufc)
tost(ufc$Height.m.p, ufc$Height.m, epsilon = 1, paired = TRUE)

[Package equivalence version 0.7.2 Index]