size_ci_one_prop {mcradds}R Documentation

Sample Size for Testing Confidence Interval of One Proportion

Description

[Experimental]

This function performs sample size computation for testing a given lower confidence interval of one proportion with the using of the Simple Asymptotic(Wald), Wilson score, clopper-pearson and other methods.

Usage

size_ci_one_prop(
  p,
  lr,
  alpha = 0.05,
  interval = c(1, 1e+05),
  tol = 1e-05,
  alternative = c("two.sided", "less", "greater"),
  method = c("simple-asymptotic", "wilson", "wald", "clopper-pearson")
)

Arguments

p

(numeric)
expected criteria of the evaluated assay.

lr

(numeric)
acceptable criteria of the evaluated assay.

alpha

(numeric)
type-I-risk, \alpha.

interval

(numeric)
a numeric vector containing the end-points of the interval to be searched for the root(sample size). The defaults are set to c(1, 100000).

tol

(numeric)
tolerance for searching the root(sample size).

alternative

(string)
string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

method

(string)
string specifying the which method to use. Simple Asymptotic is default, equal to Wald. Options can be "wilson", "clopper-pearson" and other method, see DescTools::BinomCIn

Value

an object of size class that contains the sample size and relevant parameters.

References

Newcombe, R. G. 1998. 'Two-Sided Confidence Intervals for the Single Proportion: Comparison of Seven Methods.' Statistics in Medicine, 17, pp. 857-872.

See Also

size_one_prop() size_corr() size_ci_corr()

Examples

size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "wilson")
size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "simple-asymptotic")
size_ci_one_prop(p = 0.85, lr = 0.8, alpha = 0.05, method = "wald")

[Package mcradds version 1.1.0 Index]