A function to simulate patient-level survival data for a hypothetical exposure, with simulated bias and data-source-specific random effects. Patient-level data for negative control outcomes are simulated as well to reflect systematic error.

simulateMetaAnalysisWithNegativeControls(
  meanExposureEffect = log(2),
  meanBias = 0.5,
  biasStd = 0.2,
  meanSiteEffect = 0,
  siteEffectStd = 0.1,
  mNegativeControls = 10,
  nSites = 10,
  sitePop = 2000,
  seed = 42,
  ...
)

Arguments

meanExposureEffect

Average exposure effect; has to be on the log-scale

meanBias

Average bias for the bias distribution

biasStd

Standard deviation for the bias distribution

meanSiteEffect

Average of the data-source-specific effects (typically should be zero)

siteEffectStd

Standard deviation for data-source-specific effects

mNegativeControls

Number of negative control outcomes

nSites

Number of data sources

sitePop

Population size per data source

seed

Random seed

...

Arguments that will be passed to other functions