| Hainmueller | R Documentation |
Generates the data as described in Hainmueller (2012).
An R6 object of class DataSim
DataSim -> Hainmueller
Hainmueller$gen_data()Generates the data
Hainmueller$gen_data()
Hainmueller$gen_x()Generates the covaraiate data
Hainmueller$gen_x()
Hainmueller$gen_y()Generates the outcome data
Hainmueller$gen_y()
Hainmueller$gen_z()Generates the treatment indicator
Hainmueller$gen_z()
Hainmueller$new()Generates the the Hainmueller R6 class
Hainmueller$new( n = 100, p = 6, param = list(), design = "A", overlap = "low", ... )
nThe number of observations
pThe dimensions of the covariates. Fixed to 6.
paramThe data generating parameters fed as a list.
designOne of "A" or "B". See details.
overlapOne of "high", "low", or "medium". See details.
...Extra arguments. Currently unused.
Design "A"
is the setting where the outcome is generated
from a linear model,
Y(0) = Y(1) = X_1 + X_2 + X_3 - X_4 + X_5 + X_6 + \eta
and design "B" is where the outcome is
generated from the non-linear model
Y(0) = Y(1) = (X_1 + X_2 +X_5 )^2 + \eta.
The treatment indicator is generated from
Z = 1(X_1 + 2 X_2 - 2 X_3 - X_4 - 0.5 X_5 + X_6 + \nu > 0), where \nu
depends on the overlap selected. If overlap is "high",
then \nu \sim N(0, 100). If overlap is
"low", then \nu \sim N(0, 30). Finally,
if overlap is "medium", then \nu is drawn
from a \chi^2 with 5 degrees of freedom
that is scaled and centered to have mean 0.5 and
variance 67.6.
An object of class DataSim.
data <- Hainmueller$new(n = 100, p = 6, design = "A", overlap = "low") data$gen_data() print(data$get_x()[1:2,])
Hainmueller$get_design()Returns the chosen design parameters
Hainmueller$get_design()
Hainmueller$get_pscore()Returns the true propensity score
Hainmueller$get_pscore()
Hainmueller$clone()The objects of this class are cloneable with this method.
Hainmueller$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `Hainmueller$new()`
## ------------------------------------------------
data <- Hainmueller$new(n = 100, p = 6, design = "A", overlap = "low")
data$gen_data()
print(data$get_x()[1:2,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.