get_ate.non_parametric_dag_model: Get ATE for a non paramteric DAG model

Description Usage Arguments Value See Also Examples

View source: R/get_ate.non_parametric_dag_model.R

Description

get_ate.non_parametric_dag_model uses simulations to calculate the average treatment effect (ATE) of a treatment variable on an exposure variable given a non parametric DAG model.

Usage

1
2
3
## S3 method for class 'non_parametric_dag_model'
get_ate(dag_model, treatment,
  treatment_vals = NULL, exposure, M = 1000)

Arguments

dag_model

An object of class "non_parametric_dag_model".

treatment

Name of a single treatment variable.

treatment_vals

A vector of treatment values to be considered.

exposure

Name of a single exposure variable.

M

Number of simulations to run. Each simulation dataset consists of 1000 observations.

Value

A data.frame with 3 columns:

  1. From: The baseline treatment value.

  2. To: The value a treatment was changed to.

  3. ATE: The average treatment effect of changing the treatment value from "From" to "To.

See Also

get_ate.parametric_dag_model for parametric DAG model ATE calculation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
require(carData); require(dagitty)
data("GSSvocab")
GSSvocab <- GSSvocab[complete.cases(GSSvocab), ]
g <- dagitty("dag {
             ageGroup [pos=\"0,0\"]
             vocab [pos=\"1,-1\"]
             nativeBorn [pos=\"2,-2\"]
             educ [pos=\"3,-1\"]
             gender [pos=\"4,0\"]
             nativeBorn -> educ
             nativeBorn -> vocab
             educ -> vocab
             gender -> educ
             ageGroup -> vocab
             }")
plot(g)
non_param_dag_model <- non_parametric_dag_model(dag = g, data = GSSvocab)

nativeBorn_ATE_on_vocab <- get_ate(dag_model=non_param_dag_model, 
                                   treatment="nativeBorn", 
                                   exposure="vocab")
print(nativeBorn_ATE_on_vocab)

IyarLin/simMixedDAG documentation built on Oct. 30, 2019, 7:28 p.m.