racusum_alpha_sim: Simulate false signal probability alpha given control limit...

Description Usage Arguments Value Examples

View source: R/racusum_alpha_sim.R

Description

Simulate false signal probability alpha given control limit for RA-CUSUM charts

Usage

1
2
racusum_alpha_sim(patient_risks, odds_multiplier, n_simulation, limit,
  seed = NULL)

Arguments

patient_risks

Double. Vector of patient risk scores (individual risk of adverse event)

odds_multiplier

Double. Odds multiplier of adverse event under the alternative hypothesis (<1 looks for decreases)

n_simulation

Integer. Number of simulation runs

limit

Double. Control limit for signalling performance change

seed

Integer. Seed for RNG

Value

Returns False signal probability of specified RA-CUSUM chart.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Patients risks are usually known from Phase I.
# If not, these risk scores can be simulated.

# define possible patient risk scores
risks <- c(0.001, 0.01, 0.1, 0.002, 0.02, 0.2)

# sample risk population of size n = 100
set.seed(2046)
patient_risks <- sample(x = risks, size = 100, replace = TRUE)

# control limit can be obtained with racusum_limit_sim(),
# here it is set to an arbitrary value (2.96)

# simulate false positive probability of RA-CUSUM
racusum_alpha_sim(patient_risks,
  odds_multiplier = 2,
  n_simulation = 1000,
  limit = 2.96,
  seed = 2046
)

cusum documentation built on Oct. 2, 2019, 5:03 p.m.