pattc_deepneural {DeepLearningCausal}R Documentation

Estimate PATT_C using Deep NN

Description

estimates the Population Average Treatment Effect of the Treated from experimental data with noncompliers using Deep Neural Networks.

Usage

pattc_deepneural(
  response.formula,
  exp.data,
  pop.data,
  treat.var,
  compl.var,
  compl.algorithm = "rprop+",
  response.algorithm = "rprop+",
  compl.hidden.layer = c(4, 2),
  response.hidden.layer = c(4, 2),
  compl.stepmax = 1e+08,
  response.stepmax = 1e+08,
  ID = NULL,
  cluster = NULL,
  binary.outcome = FALSE,
  bootstrap = FALSE,
  nboot = 1000
)

Arguments

response.formula

formula of response variable as outcome and covariates (y ~ x)

exp.data

data.frame of experimental data. Must include binary treatment and compliance variables.

pop.data

data.frame of population data. Must include binary compliance variable

treat.var

string for treatment variable.

compl.var

string for compliance variable

compl.algorithm

string for algorithim to train neural network for compliance model. Default set to "rprop+". See (neuralnet package for available algorithms).

response.algorithm

string for algorithim to train neural network for response model. Default set to "rprop+". See (neuralnet package for available algorithms).

compl.hidden.layer

vector for specifying hidden layers and number of neurons in complier model.

response.hidden.layer

vector for specifying hidden layers and number of neurons in response model.

compl.stepmax

maximum number of steps for complier model

response.stepmax

maximum number of steps for response model

ID

string for identifier variable

cluster

string for cluster variable.

binary.outcome

logical specifying predicted outcome variable will take binary values or proportions.

bootstrap

logical for bootstrapped PATT-C.

nboot

number of bootstrapped samples

Value

pattc_deepneural class object of results of t test as PATTC estimate.

Examples


# load datasets
data(exp_data) #experimental data
data(pop_data) #population data
# specify models and estimate PATTC
set.seed(123456)
pattc_neural <- pattc_deepneural(response.formula = support_war ~ age + female +
                               income + education +  employed + married +
                               hindu + job_loss,
                               exp.data = exp_data,
                               pop.data = pop_data,
                               treat.var = "strong_leader",
                               compl.var = "compliance",
                               compl.algorithm = "rprop+",
                               response.algorithm = "rprop+",
                               compl.hidden.layer = c(4,2),
                               response.hidden.layer = c(4,2),
                               compl.stepmax = 1e+09,
                               response.stepmax = 1e+09,
                               ID = NULL,
                               cluster = NULL,
                               binary.outcome = FALSE)

print(pattc_neural)

pattc_neural_boot <- pattc_deepneural(response.formula = support_war ~ age + female +
                               income + education +  employed + married +
                               hindu + job_loss,
                               exp.data = exp_data,
                               pop.data = pop_data,
                               treat.var = "strong_leader",
                               compl.var = "compliance",
                               compl.algorithm = "rprop+",
                               response.algorithm = "rprop+",
                               compl.hidden.layer = c(4,2),
                               response.hidden.layer = c(4,2),
                               compl.stepmax = 1e+09,
                               response.stepmax = 1e+09,
                               ID = NULL,
                               cluster = NULL,
                               binary.outcome = FALSE,
                               bootstrap = TRUE,
                               nboot = 2000)

print(pattc_neural_boot)




[Package DeepLearningCausal version 0.0.104 Index]