Skip to contents

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

if (FALSE) {
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)
}