simulateTwoCauseFineGrayModel: Simulate data from the Fine-Gray Model

Description Usage Arguments Details Value References Examples

Description

Simulate data from the model proposed in Fine and Gray (1999) for two causes. Cause 1 is assumed to be of primary importance.

Usage

1
2
simulateTwoCauseFineGrayModel(nobs, beta1, beta2, X = NULL, u.min = 0,
  u.max, p = 0.5, returnX = FALSE)

Arguments

nobs

Integer: Number of observations in simulated dataset.

beta1

A vector of effect sizes for cause 1 of length ncovs

beta2

A vector of effect sizes for cause 2 of length ncovs

X

A matrix of fixed covariates (nobs x ncovs). If X is NULL (default) then X will be simulated from MVN(O, I) with n = nobs and p = length(beta1).

u.min

Numeric: controls lower bound of censoring distribution where C ~ U(u.min, u.max)

u.max

Numeric: controls upper bound of censoring distribution where C ~ U(u.min, u.max)

p

Numeric: value between 0 and 1 which controls the mixture probability.

returnX

Logical: Whether to return X or not. Default is TRUE. Recommended if X is NULL.

Details

The function simulates data according to the setup by Fine and Gray (1999). See their paper for more information.

Value

Returns a list with ftime, fstatus, X.

References

Fine J. and Gray R. (1999) A proportional hazards model for the subdistribution of a competing risk. JASA 94:496-509.

Examples

1
2
3
4
5
6
set.seed(10)
nobs <- 500
beta1 <- c(0.5, 0.4, 0, 0, 0.35, 0, 0, 0.7)
beta2 <- -beta1
X <- matrix(rnorm(nobs * 8), nrow = nobs)
dat <- simulateTwoCauseFineGrayModel(nobs, beta1, beta2, X, u.min = 0, u.max = 1, p = 0.5)

erickawaguchi/crrBAR documentation built on June 6, 2019, 7:56 a.m.