sim_outcome_survival: Simulate a survival outcome

View source: R/sim_outcome_survival.R

sim_outcome_survivalR Documentation

Simulate a survival outcome

Description

Simulate a survival outcome

Usage

sim_outcome_survival(
  data,
  formula,
  reg_coefs,
  basehaz_type = "spline",
  beta_Bh0 = NULL,
  shape_wb = NULL,
  knot_range = NULL,
  mean_cens = 30,
  .tries = 5L,
  .up = 5000L,
  up_step = 5000L,
  seed = NULL,
  add_info = FALSE,
  ...
)

Arguments

data

a data.frame containing covariate data

formula

the model formula

reg_coefs

a vector of regression coefficients. If named, the names will be matched with the names of the design matrix that is created from formula and data.

basehaz_type

character string specifying the type of baseline hazard: weibull or spline

beta_Bh0

vector of coefficients for a spline specification of the baseline hazard

shape_wb

parameter of the Wishart distribution

knot_range

range of the knots for a spline baseline hazard

mean_cens

mean censoring time

.tries

integer; how often is the upper limit increased when looking for the root

.up

upper limit for the integration over the hazard

up_step

step with which .up is increased in case of failure

seed

the seed value

add_info

logical: should the simulated true_times, cens_times and lin_pred be added as columns to the data

...

arguments passed to other functions


NErler/simvalidator documentation built on May 17, 2022, 7:54 a.m.