confseq_ate: Confidence sequence for the average treatment effect.

View source: R/confseq_ate.R

confseq_ateR Documentation

Confidence sequence for the average treatment effect.

Description

Confidence sequence for the average treatment effect.

Usage

confseq_ate(
  y,
  X,
  treatment,
  regression_fn_1 = get_SL_fn(),
  regression_fn_0 = NULL,
  propensity_score_fn = get_SL_fn(family = binomial()),
  t_opt,
  train_idx = NULL,
  alpha = 0.05,
  times = NULL,
  n_cores = 1,
  cross_fit = TRUE,
  lyapunov = FALSE
)

Arguments

y

The measured outcome (a real vector).

X

Measured covariates (an nxd real matrix where 'n = length(y)')

treatment

Whether the subject received treatment (a boolean vector or 0/1-valued integer vector).

regression_fn_1

A function which predicts outcomes for those who took treatment. This function takes three arguments: 'y', 'X', and 'newX', the training outcome, training covariates, and evaluation covariates, respectively. The function outputs the predicted response given the evaluation covariates, 'newX'.

regression_fn_0

The same as 'regression_fn_1' but for those who did not receive treatment. If left NULL, this will be set to the same function as 'regression_fn_1'.

propensity_score_fn

A function which predicts the propensity score for each subject. Similar to 'regression_fn_1', this function takes three arguments: 'y', 'X', and 'newX', the training treatment indicator (1 if treatment, 0 if control), the training covariates, and the evaluation covariates. The function outputs the predicted propensity score given the evaluation covariates, 'newX'.

t_opt

Time for which the CS should be tightest

train_idx

The indices indicating the training split for the sample splitting algorithm. If left NULL, the training index will be assigned randomly with probability 1/2.

alpha

Confidence level between 0 and 1 (real)

times

The times for which the doubly-robust variables should be calculated. Can be a vector of times (an integer vector) or a single time (integer). If left NULL, the variables will only be computed at time n.

n_cores

The number of cores to use for parallelization.

cross_fit

Should cross-fitting be used? (boolean)

Value

Data frame containing the lower and upper confidence sequences.


WannabeSmith/drconfseq documentation built on Sept. 13, 2023, 3:05 a.m.