updateAlpha: Update alpha values for existing simulation

View source: R/updatealpha.r

updateAlphaR Documentation

Update alpha values for existing simulation

Description

Report interval estimates with updated alpha values, using a previously evaluated simulation.

Usage

updateAlpha(x, newAlpha)

Arguments

x

output from estimateSnSp

newAlpha

updated alpha value. Must be within [0, 1]

Value

an object of type snsp. See output for estimateSnSp

Author(s)

DiagTestKit-package

See Also

estimateSnSpControl

Examples

data.1 <- data.frame(
  exp_result = rep(c("positive", "negative"), each = 2),
  ref1_result = rep(c("positive", "negative"), 2),
  count = c(82, 11, 5, 22))
example.1 <- estimateSnSp(dat      = data.1,
                          Sn.ref   = data.frame(ref = c(0.90, 0)),
                          Sp.ref   = data.frame(ref = c(0.99, 0)),
                          prev.pop = c(A = 0.80),
                          control  = estimateSnSpControl(seed = 64725))
example.1a <- updateAlpha(example.1, newAlpha = 0.25)
example.1a

# 1000  simulations
# 75 % Interval Estimates
#
#                    Point.Estimate     Lower     Upper
# Sn = P(T+|D+)      0.9449821          0.9053901 0.9791017
# Sp = P(T-|D-)      0.9062769          0.8336064 1.0000000

ABS-dev/DiagTestKit documentation built on Sept. 23, 2024, 9:37 a.m.