Simulate survival data for MaxSPRT computation
simulateMaxSprtData(
n = 10000,
pExposure = 0.5,
backgroundHazard = 0.001,
tar = 10,
nullMu = 0.2,
nullSigma = 0.2,
maxT = 100,
looks = 10,
numberOfNegativeControls = 50,
numberOfPositiveControls = 1,
positiveControlEffectSize = 4
)
Number of subjects.
Probability of being in target cohort.
Background hazard (risk of the outcome per day).
Time at risk for each exposure
Null distribution mean (at log HR scale)
Null distribution SD (at log HR scale)
Maximum time to simulate.
Number of (evenly spaced) looks at the data.
Number of negative controls to simulate.
Number of positive controls to simulate.
The true effect size of the positive controls.
A data frame with 5 variables:
Time from index date to either the event or end of observation, whichever came first
Whether the outcome occurred (1) or not (0)
Whether the subject was exposed (TRUE) or not (FALSE)
The time point when the look occurred.
A unique identifier for data corresponding to a single outcome. Lower IDs indicate negative controls, higher IDs indicate the positive control
Simulate survival data for negative and positive controls. The data provides multiple looks at data accruing over time, with each look having more data than the one before. Systematic error for each outcome is drawn from the prespecified null distribution.
The outcome IDs are assigned sequentially starting at 1, with the first IDs used for the negative controls, and the latter IDs used for the positive controls.
data <- simulateMaxSprtData(n = 1000)
head(data)
#> time outcome exposure lookTime outcomeId
#> 5 8.661996 0 TRUE 10 1
#> 11 9.386998 0 TRUE 10 1
#> 20 0.498716 0 FALSE 10 1
#> 22 7.061753 0 TRUE 10 1
#> 85 3.030036 0 TRUE 10 1
#> 98 2.959496 0 TRUE 10 1