causalglmnet: causalglmnet High dimensional semiparametric generalized...

View source: R/causalglmnet.R

causalglmnetR Documentation

causalglmnet High dimensional semiparametric generalized linear models for causal inference using the LASSO. Supports flexible semiparametric conditional average treatment effect (CATE), conditional odds ratio (OR), and conditional relative risk (RR) estimation cv.glmnet is used to fit all nuisance parameters. The parametric component of the semiparametric model is not penalized. This function is almost just a wrapper for causalglm.

Description

causalglmnet High dimensional semiparametric generalized linear models for causal inference using the LASSO. Supports flexible semiparametric conditional average treatment effect (CATE), conditional odds ratio (OR), and conditional relative risk (RR) estimation cv.glmnet is used to fit all nuisance parameters. The parametric component of the semiparametric model is not penalized. This function is almost just a wrapper for causalglm.

Usage

causalglmnet(
  formula,
  data,
  W,
  A,
  Y,
  estimand = c("CATE", "OR", "RR"),
  max_degree = 1,
  cross_fit = TRUE,
  constant_variance_CATE = FALSE,
  weights = NULL,
  parallel = TRUE,
  verbose = TRUE,
  ...
)

Arguments

formula

A R formula object specifying the parametric form of CATE, OR, or RR (depending on method).

data

A data.frame or matrix containing the numeric values corresponding with the nodes W, A and Y.

W

A character vector of covariates contained in data

A

A character name for the treatment assignment variable contained in data

Y

A character name for the outcome variable contained in data (outcome can be continuous, nonnegative or binary depending on method)

estimand

Estimand/parameter to estimate. Choices are: CATE: Estimate conditional average treatment effect with Param_spCATE assuming it satisfies parametric model formula. OR: Estimate conditional odds ratio with Param_spOR assuming it satisfies parametric model formula. RR: Estimate conditional relative risk with Param_spRR assuming it satisfies parametric model formula.

cross_fit

Whether to cross-fit the initial estimator. This is always set to FALSE if argument sl3_Learner is provided. learning_method = 'SuperLearner' is always cross-fitted (default). learning_method = 'xgboost' and 'ranger' are always cross-fitted regardless of the value of cross_fit All other learning_methods are only cross-fitted if 'cross_fit=TRUE'. Note, it is not necessary to cross-fit glm, glmnet, gam or mars as long as the dimension of W is not too high. In smaller samples and lower dimensions, it may fact hurt to cross-fit.

weights

An optional vector of weights to use in procedure.

parallel

See cv.glmnet

...

Other arguments to pass to cv.glmnet


Larsvanderlaan/causalGLM documentation built on April 14, 2022, 12:51 a.m.