R: Simulate causal survival data

generate_causal_survival_data {grf} | R Documentation

## Simulate causal survival data

### Description

The following DGPs are available for benchmarking purposes, T is the failure time and C the censoring time:

- "simple1": T = X1*eps + W, C ~ U(0, 2) where eps ~ Exp(1) and Y.max = 1.

- "type1": T is drawn from an accelerated failure time model and C from a Cox model (scenario 1 in https://arxiv.org/abs/2001.09887)

- "type2": T is drawn from a proportional hazard model and C from a accelerated failure time (scenario 2 in https://arxiv.org/abs/2001.09887)

- "type3": T and C are drawn from a Poisson distribution (scenario 3 in https://arxiv.org/abs/2001.09887)

- "type4": T and C are drawn from a Poisson distribution (scenario 4 in https://arxiv.org/abs/2001.09887)

- "type5": is similar to "type2" but with censoring generated from an accelerated failure time model.

### Usage

    generate_causal_survival_data(
      n,
      p,
      Y.max = NULL,
      X = NULL,
      n.mc = 10000,
      dgp = c("simple1", "type1", "type2", "type3", "type4", "type5")
    )

### Arguments

`n` | The number of samples.
`p` | The number of covariates.
`Y.max` | The maximum follow-up time (optional).
`X` | The covariates (optional).
`n.mc` | The number of monte carlo draws to estimate the treatment effect with. Default is 10000.
`dgp` | The type of DGP.

### Value

A list with entries: 'X': the covariates, 'Y': the event times, 'W': the treatment indicator, 'D': the censoring indicator, 'cate': the treatment effect estimated by monte carlo, 'cate.sign': the true sign of the cate for ITR comparison, 'dgp': the dgp name, 'Y.max': the maximum follow-up time.

### Examples

    # Generate data
    n <- 1000
    p <- 5
    data <- generate_causal_survival_data(n, p)
    # Get true CATE on a test set
    X.test <- matrix(seq(0, 1, length.out = 5), 5, p)
    cate.test <- generate_causal_survival_data(n, p, X = X.test)$cate

[Package grf version 2.0.1 Index]