| LocalBumps | R Documentation |
Generates data where the outcome is a checkerboard of Gaussian bumps in the first two covariates. The bandwidth sets how local the outcome is.
An R6 object of class DataSim
DataSim -> LocalBumps
LocalBumps$gen_data()Generates the data
LocalBumps$gen_data()
LocalBumps$gen_x()Generates the covariate data
LocalBumps$gen_x()
LocalBumps$gen_y()Generates the outcome data
LocalBumps$gen_y()
LocalBumps$gen_z()Generates the treatment indicator
LocalBumps$gen_z()
LocalBumps$new()Generates the the LocalBumps R6 class
LocalBumps$new( n = 100, p = 2, param = list(), bandwidth = 0.5, overlap = "low", ... )
nThe number of observations
pThe dimensions of the covariates. At least 2; covariates past the second are noise.
paramThe data generating parameters fed as a list.
bandwidthThe standard deviation of each bump. Smaller values give a more local outcome.
overlapOne of "low" or "high". See details.
...Extra arguments. Currently unused.
X \sim N(0, I_p).
Y(0) = Y(1) = \beta_y f_h(X_1, X_2) + \eta, where
f_h is a sum of Gaussian bumps with standard
deviation h (bandwidth), centered on the
grid \{-1.5, 0, 1.5\}^2 with alternating
signs, and standardized to mean 0 and variance 1
under the distribution of X. The default
parameters are \beta_y = 2 and
\eta \sim N(0, 1).
The treatment indicator is
Z \sim Bernoulli(logit^{-1}(\beta_z (X_1 + X_2) + \beta_f f_h(X_1, X_2))),
where \beta_z = 2 if overlap is "low" and
\beta_z = 0.5 if overlap is "high". The
default \beta_f = 1. The \beta_f term
ties treatment to the bumps, so the confounding
is local when h is small and smooth when
h is large. With \beta_f = 0 the
checkerboard averages out along X_1 + X_2
and there is almost no confounding.
An object of class DataSim.
data <- LocalBumps$new(n = 100, p = 2, bandwidth = 0.5, overlap = "low") data$gen_data() print(data$get_x()[1:2,])
LocalBumps$get_design()Returns the chosen design parameters
LocalBumps$get_design()
LocalBumps$get_pscore()Returns the true propensity score
LocalBumps$get_pscore()
LocalBumps$clone()The objects of this class are cloneable with this method.
LocalBumps$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `LocalBumps$new()`
## ------------------------------------------------
data <- LocalBumps$new(n = 100, p = 2, bandwidth = 0.5, 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.