cdgd1_ml {cdgd}R Documentation

Perform conditional decomposition via machine learning

Description

Perform conditional decomposition via machine learning

Usage

cdgd1_ml(Y, D, G, X, Q, data, algorithm, alpha = 0.05, trim1 = 0, trim2 = 0)

Arguments

Y

Outcome. The name of a numeric variable (can be binary and take values of 0 and 1).

D

Treatment status. The name of a binary numeric variable taking values of 0 and 1.

G

Advantaged group membership. The name of a binary numeric variable taking values of 0 and 1.

X

Confounders. A vector of variables names.

Q

Conditional set. A vector of names of numeric variables.

data

A data frame.

algorithm

The ML algorithm for modelling. "nnet" for neural network, "ranger" for random forests, "gbm" for generalized boosted models.

alpha

1-alpha confidence interval.

trim1

Threshold for trimming the propensity score. When trim1=a, individuals with propensity scores lower than a or higher than 1-a will be dropped.

trim2

Threshold for trimming the G given Q predictions. When trim2=a, individuals with G given Q predictions lower than a or higher than 1-a will be dropped.

Value

A dataframe of estimates.

Examples

# This example will take a minute to run.

data(exp_data)

set.seed(1)

results <- cdgd1_ml(
Y="outcome",
D="treatment",
G="group_a",
X="confounder",
Q="Q",
data=exp_data,
algorithm="gbm")

results

[Package cdgd version 0.3.5 Index]