sim_outcome_joint_model: Simulate a survival and longitudinal outcome for a joint...

View source: R/sim_outcome_joint_model.R

sim_outcome_joint_modelR Documentation

Simulate a survival and longitudinal outcome for a joint model

Description

Simulate a survival and longitudinal outcome for a joint model

Usage

sim_outcome_joint_model(
  data,
  formula,
  reg_coefs,
  resid_sd,
  beta_Bh0 = NULL,
  ranef_vcov,
  type,
  timevar = "time",
  basehaz_type = "splines",
  shape_wb = 1.2,
  mean_cens = 30,
  .tries = 5,
  .up = 500L,
  up_step = 500L,
  knots = NULL,
  knot_range = NULL,
  seed = NULL,
  no_obs_after_event = TRUE,
  no_subset = FALSE,
  progress_bar = FALSE,
  ...
)

Arguments

data

a data.frame containing covariate data

formula

a list of model formulas for the survival and longitudinal outcomes

reg_coefs

a list of regression coefficients with elements "surv" and "long". Each of the list elements is a (named) vector. If named, the names will be matched with the names of the design matrix that is created from formula and data.

resid_sd

vector of residual standard deviations for longitudinal outcomes

beta_Bh0

vector of coefficients for a spline specification of the baseline hazard

ranef_vcov

a random effects variance-covariance matrix or a named list of such matrices when there are more than two levels (and names being equal to the grouping variables)

type

vector of type specifications for longitudinal outcomes

timevar

character string giving the variable name of the time variable for the longitudinal outcome. Should be different from the name of the survival time variable.

basehaz_type

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

shape_wb

shape parameter of the weibull distribution

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

knots

knots for baseline hazard spline

knot_range

range of the knots for a spline baseline hazard; if knots are not available

seed

the seed value

no_obs_after_event

logical; should observations of the longitudinal outcome with times after the corresponding event/ censoring time be removed?

no_subset

logical; used for "debugging"

progress_bar

logical: should a progress bar be displayed

...

arguments passed to other functions


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