[Superseded]

Development on TOSTtwo.prop is complete, and for new code we recommend switching to twoprop_test, which is easier to use, more featureful, and still under active development.

TOSTtwo.prop(
  prop1,
  prop2,
  n1,
  n2,
  low_eqbound,
  high_eqbound,
  alpha,
  ci_type = "normal",
  plot = TRUE,
  verbose = TRUE
)

Arguments

prop1

proportion of group 1

prop2

proportion of group 2

n1

sample size in group 1

n2

sample size in group 2

low_eqbound

lower equivalence bounds (e.g., -0.1) expressed in proportions

high_eqbound

upper equivalence bounds (e.g., 0.1) expressed in proportions

alpha

alpha level (default = 0.05)

ci_type

confidence interval type (default = "normal"). "wilson" produces Wilson score intervals with a Yates continuity correction while "normal" calculates the simple asymptotic method with no continuity correction.

plot

set whether results should be plotted (plot = TRUE) or not (plot = FALSE) - defaults to TRUE

verbose

logical variable indicating whether text output should be generated (verbose = TRUE) or not (verbose = FALSE) - default to TRUE

Value

Returns TOST z-value 1, TOST p-value 1, TOST z-value 2, TOST p-value 2, low equivalence bound, high equivalence bound, Lower limit confidence interval TOST, Upper limit confidence interval TOST

References

Tunes da Silva, G., Logan, B. R., & Klein, J. P. (2008). Methods for Equivalence and Noninferiority Testing. Biology of Blood Marrow Transplant, 15(1 Suppl), 120-127.

Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. Hoboken, New Jersey: John Wiley & Sons, Inc.

Examples

## Equivalence test for two independent proportions equal to .65 and .70, with 100 samples
## per group, lower equivalence bound of -0.1, higher equivalence bound of 0.1, and alpha of 0.05.

TOSTtwo.prop(prop1 = .65, prop2 = .70, n1 = 100, n2 = 100,
   low_eqbound = -0.1, high_eqbound = 0.1, alpha = .05)
#> TOST results:
#> Z-value lower bound: 0.756 	p-value lower bound: 0.225
#> Z-value upper bound: -2.27 	p-value upper bound: 0.012
#> 
#> Equivalence bounds:
#> low eqbound: -0.1 
#> high eqbound: 0.1
#> 
#> TOST confidence interval:
#> lower bound 90% CI: -0.159
#> upper bound 90% CI:  0.059
#> 
#> NHST confidence interval:
#> lower bound 95% CI: -0.18
#> upper bound 95% CI:  0.08
#> 
#> Equivalence Test based on Fisher's exact z-test Result:
#> The equivalence test was non-significant, Z = 0.756, p = 0.225, given equivalence bounds of -0.100 and 0.100 and an alpha of 0.05.
#> 
#> 
#> Null-Hypothesis Fisher's exact z-test Result:
#> The null hypothesis test was non-significant, Z = -0.756, p = 0.450, given an alpha of 0.05.
#> 
#> 
#> NHST: don't reject null significance hypothesis that the effect is equal to 0 
#> TOST: don't reject null equivalence hypothesis