settings <- createSccsSimulationSettings(nSites = 1, rateRatio = 2)
populations <- simulatePopulations(settings)
# Fit a SCCS regression for the simulated data site:
cyclopsData <- Cyclops::createCyclopsData(
y ~ a + x1 + x2 + x3 + x4 + x5 + strata(stratumId) + offset(log(time)),
data = populations[[1]],
modelType = "cpr"
)
cyclopsFit <- Cyclops::fitCyclopsModel(cyclopsData)
coef(cyclopsFit)
# (Estimates in this example will vary due to the random simulation)
Run the code above in your browser using DataLab