simulatePopulations {EvidenceSynthesis}R Documentation

Simulate survival data for multiple databases

Description

Simulate survival data for multiple databases

Usage

simulatePopulations(settings = createSimulationSettings())

Arguments

settings

An object of type simulationSettings, created by the createSimulationSettings() function.

Value

A object of class simulation, which is a list of populations, each a data frame with columns rowId, stratumId, x, time, and y.

Examples

settings <- createSimulationSettings(nSites = 1, hazardRatio = 2)
populations <- simulatePopulations(settings)

# Fit a Cox regression for the simulated data site:
cyclopsData <- Cyclops::createCyclopsData(Surv(time, y) ~ x + strata(stratumId),
  data = populations[[1]],
  modelType = "cox"
)
cyclopsFit <- Cyclops::fitCyclopsModel(cyclopsData)
coef(cyclopsFit)

# (Estimates in this example will vary due to the random simulation)


[Package EvidenceSynthesis version 0.5.0 Index]