A function for TOST on the log-transformed data using parametric t-tests.

log_TOST(
x,
...,
hypothesis = "EQU",
paired = FALSE,
var.equal = FALSE,
eqb = 1.25,
alpha = 0.05,
null = 1
)

# S3 method for default
log_TOST(
x,
y = NULL,
hypothesis = c("EQU", "MET"),
var.equal = FALSE,
paired = FALSE,
eqb = 1.25,
alpha = 0.05,
null = 1,
...
)

# S3 method for formula
log_TOST(formula, data, subset, na.action, ...)

## Arguments

x

a (non-empty) numeric vector of data values.

...

further arguments to be passed to or from methods.

hypothesis

'EQU' for equivalence (default), or 'MET' for minimal effects test, the alternative hypothesis.

paired

a logical indicating whether you want a paired t-test.

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.

eqb

Equivalence bound; default is 1.25 (FDA guidelines). Can provide 1 value (reciprocal value is taken as the lower bound) or 2 specific values that represent the upper and lower equivalence bounds.

alpha

alpha level (default = 0.05)

null

Null hypothesis value for a two-tailed test (default is 1).

y

an optional (non-empty) numeric vector of data values.

formula

a formula of the form lhs ~ rhs where lhs is a numeric variable giving the data values and rhs either 1 for a one-sample or paired test or a factor with two levels giving the corresponding groups. If lhs is of class "Pair" and rhs is 1, a paired test is done.

data

an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used.

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

## Value

An S3 object of class "TOSTt" is returned containing the following slots:

• "TOST": A table of class "data.frame" containing two-tailed t-test and both one-tailed results.

• "eqb": A table of class "data.frame" containing equivalence bound settings.

• "effsize": table of class "data.frame" containing effect size estimates.

• "hypothesis": String stating the hypothesis being tested

• "smd": List containing the results of the means ratio calculation.

• Items include: d (means ratio estimate), dlow (lower CI bound), dhigh (upper CI bound), d_df (degrees of freedom for SMD), d_sigma (SE), d_lambda (non-centrality), J (bias correction), smd_label (type of SMD), d_denom (denominator calculation)

• "alpha": Alpha level set for the analysis.

• "method": Type of t-test.

• "decision": List included text regarding the decisions for statistical inference.

## Details

For details on the calculations in this function see vignette("robustTOST").

For two-sample tests, the test is of $$\bar log(x) - \bar log(y)$$ (mean of x minus mean of y). For paired samples, the test is of the difference scores (z), wherein $$z = log(x) - log(y) = log(x)/log(y)$$, and the test is of $$\bar z$$ (mean of the difference/ratio scores).

## References

He, Y., Deng, Y., You, C., & Zhou, X. H. (2022). Equivalence tests for ratio of means in bioequivalence studies under crossover design. Statistical Methods in Medical Research, 09622802221093721.

Food and Drug Administration (2014). Bioavailability and Bioequivalence Studies Submitted in NDAs or INDs — General Considerations. Center for Drug Evaluation and Research. Docket: FDA-2014-D-0204. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/bioavailability-and-bioequivalence-studies-submitted-ndas-or-inds-general-considerations

Other Robust tests: boot_log_TOST(), boot_t_TOST(), boot_t_test(), brunner_munzel(), wilcox_TOST()

## Examples

data(mtcars)
# Default FDA bioequivalence bounds
log_TOST(mpg ~ am,
data = mtcars)
#>
#> Log-transformed Welch Two Sample t-test
#>
#> The equivalence test was non-significant, t(23.96) = -1.363, p = 9.07e-01
#> The null hypothesis test was significant, t(23.96) = -3.826, p = 8.19e-04
#> NHST: reject null significance hypothesis that the effect is equal to one
#> TOST: don't reject null equivalence hypothesis
#>
#> TOST Results
#>                 t    df p.value
#> t-test     -3.826 23.96 < 0.001
#> TOST Lower -1.363 23.96   0.907
#> TOST Upper -6.288 23.96 < 0.001
#>
#> Effect Sizes
#>                  Estimate      SE               C.I. Conf. Level
#> log(Means Ratio)  -0.3466 0.09061 [-0.5017, -0.1916]         0.9
#> Means Ratio        0.7071      NA   [0.6055, 0.8256]         0.9
#>
#>