Learn R Programming

stpm (version 1.1.2)

simdata_time_dep: Simulation function for continuous trait with time-dependant coefficients.

Description

Simulation function for continuous trait with time-dependant coefficients.

Usage

simdata_time_dep(N = 10, f = list(at = "-0.05", f1t = "80", Qt = "2e-5", ft
  = "80", bt = "2.5", mu0t = "1e-1"), step = 1, tstart = 30, tend = 105,
  ystart = 80, sd0 = 2)

Arguments

N
Number of individuals.
f
a list of formulas that define age (time) - dependency. Default: list(at="a", f1t="f1", Qt="Q*exp(theta*t)", ft="f", bt="b", mu0t="mu0*exp(theta*t)")
step
An interval between two observations, a random uniformally-distributed value is then added to this step.
tstart
A number that defines starting time (30 by default).
tend
A number, defines final time (105 by default).
ystart
A starting value of covariates.
sd0
A standard deviation for modelling the next covariate value.

Value

  • A table with simulated data.

References

Yashin, A. et al (2007), Health decline, aging and mortality: how are they related? Biogerontology, 8(3), 291-302..

Examples

Run this code
library(stpm)
dat <- simdata_time_dep(N=100)
head(dat)

Run the code above in your browser using DataLab