DMLReg: Simple Double-ML implementation with cross-fitting

View source: R/causalFns.R

DMLRegR Documentation

Simple Double-ML implementation with cross-fitting

Description

Simple Double-ML implementation with cross-fitting

Usage

DMLReg(x, d, y, dreg, yreg, nfold = 5)

Arguments

x

Matrix of covariates

d

treatment variable

y

The dependent variable

dreg

function that wraps learner - e.g. glmnet - for pscore

yreg

function that wraps learner - e.g. glmnet - for outcome regression

D

vector of factor variables to be partialed out

nfolds

number of folds for cross fitting

Examples

## Not run: 
dreg = \(x, d) cv.glmnet(x, d, alpha = 1)
yreg = \(x, y) cv.glmnet(x, y, alpha = 1)
res = DMLReg(x = x, d = d, y = y, dreg = dreg, yreg = yreg, nfold = 5)

## End(Not run)

apoorvalal/LalRUtils documentation built on Sept. 22, 2023, 5:53 p.m.