Learn R Programming

JMcmprsk (version 0.9.6)

SimDataC: Data simulation of continuous outcomes and competing risks

Description

Simulation of continuous longitudinal outcome and competing risks data Currently, only the simulation in Elashoff et al(2008) is implemented.

Usage

SimDataC(k_val, p1_val, p1a_val, p2_val, g_val, truebeta, truegamma,
  randeffect, yfn, cfn, mfn)

Arguments

k_val

The number of subjects in study.

p1_val

The dimension of fixed effects in longitudinal measurements.

p1a_val

The dimension of random effects in longitudinal measurements.

p2_val

The dimension of fixed effects in competing risks failure time data.

g_val

The number of type of failure in competing risks data.

truebeta

True values for beta, the longitudinal coefficients.

truegamma

True values for gamma, the survival coefficients.

randeffect

True values for random effects in longitudinal and competing risks parts,namely in the order of \(\sigma\),\(\sigma_b\),\(\nu_2\),\(\sigma_u\).

yfn

Filename of genereated Y matrix for longitudinal measurements in long format.

cfn

Filename of genereated C matrix for competing risks failure time data.

mfn

Filename of genereated M vector to indicate the number of longitudinal measurements per subject.

Value

Files with names yfn, cfn and mfn.

References

  • Elashoff, Robert M., Gang Li, and Ning Li. "A joint model for longitudinal measurements and survival data in the presence of multiple failure types." Biometrics 64.3 (2008): 762-771.

See Also

SimDataO

Examples

Run this code
# NOT RUN {
# A toy example testint data generations
require(JMcmprsk)
set.seed(123)
yfn=tempfile(pattern = "", fileext = ".txt")
cfn=tempfile(pattern = "", fileext = ".txt")
mfn=tempfile(pattern = "", fileext = ".txt")
k_val=30;p1_val=4;p1a_val=1; p2_val=2;g_val=2;
truebeta=c(10,-1,1.5,0.6);truegamma=c(0.8,-1,0.5,-1); randeffect=c(5,0.5,0.5,0.5);
#writing files
SimDataC(k_val, p1_val, p1a_val, p2_val, g_val,truebeta, 
         truegamma, randeffect, yfn,  cfn,  mfn)
# }
# NOT RUN {
jmc(p=4,yfn,cfn,mfn,point=6)
# }

Run the code above in your browser using DataLab