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:

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.2 Index]