Description Usage Arguments Details Value Author(s) References Examples

This function simulates multivariate longitudinal and time-to-event data from a joint model.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |

`n` |
the number of subjects to simulate data for. |

`ntms` |
the maximum number of (discrete) time points to simulate repeated longitudinal measurements at. |

`beta` |
a matrix of |

`gamma.x` |
a vector of |

`gamma.y` |
a vector of |

`sigma2` |
a vector of |

`D` |
a positive-definite matrix specifying the variance-covariance
matrix. If |

`df` |
a non-negative scalar specifying the degrees of freedom for the
random effects if sampled from a multivariate |

`model` |
follows the model definition in the |

`theta0, theta1` |
parameters controlling the failure rate. See Details. |

`censoring` |
logical: if |

`censlam` |
a scale ( |

`truncation` |
logical: if |

`trunctime` |
a truncation time for use when |

The function `simData`

simulates data from a joint model,
similar to that performed in Henderson et al. (2000). It works by first
simulating multivariate longitudinal data for all possible follow-up times
using random draws for the multivariate Gaussian random effects and
residual error terms. Data can be simulated assuming either
random-intercepts only in each of the longitudinal sub-models, or
random-intercepts and random-slopes. Currently, all models must have the
same structure. The failure times are simulated from proportional hazards
time-to-event models using the following methodologies:

`model="int"`

The baseline hazard function is specified to be an exponential distribution with

*λ_0(t) = \exp{θ_0}.*Simulation is conditional on known time-independent effects, and the methodology of Bender et al. (2005) is used to simulate the failure time.

`model="intslope"`

The baseline hazard function is specified to be a Gompertz distribution with

*λ_0(t) = \exp{θ_0 + θ_1 t}.*In the usual representation of the Gompertz distribution,

*θ_1*is the shape parameter, and the scale parameter is equivalent to*\exp(θ_0)*. Simulation is conditional on on a predictable (linear) time-varying process, and the methodology of Austin (2012) is used to simulate the failure time.

A list of 2 `data.frame`

s: one recording the requisite
longitudinal outcomes data, and one recording the time-to-event data.

Pete Philipson (peter.philipson1@newcastle.ac.uk) and Graeme L. Hickey (graemeleehickey@gmail.com)

Austin PC. Generating survival times to simulate Cox proportional hazards
models with time-varying covariates. *Stat Med.* 2012; **31(29)**:
3946-3958.

Bender R, Augustin T, Blettner M. Generating survival times to simulate Cox
proportional hazards models. *Stat Med.* 2005; **24**: 1713-1723.

Henderson R, Diggle PJ, Dobson A. Joint modelling of longitudinal
measurements and event time data. *Biostatistics.* 2000; **1(4)**:
465-480.

1 2 3 4 5 6 7 8 9 |

```
Loading required package: nlme
Loading required package: survival
25.6% experienced event
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.