DataSim | R Documentation |
R6 Data Generating Parent Class
R6 Data Generating Parent Class
Can be used to make your own data simulation class. Should have the same slots listed in this class at a minimum, but you can add your own, of course. An easy way to do this is to make your class inherit from this one. See the example.
An R6 object
get_x()
Gets the covariate data
DataSim$get_x()
get_y()
Gets the outcome vector
DataSim$get_y()
get_z()
Gets the treatment indicator
DataSim$get_z()
get_n()
Gets the number of observations
DataSim$get_n()
get_x1()
Gets the covariate data for the treated individuals
DataSim$get_x1()
get_x0()
Gets the covaraiate data for the control individuals
DataSim$get_x0()
get_p()
Gets the dimensionality covariate data
DataSim$get_p()
get_tau()
Gets the individual treatment effects
DataSim$get_tau()
gen_data()
Generates the data. Default is an empty function
DataSim$gen_data()
clone()
The objects of this class are cloneable with this method.
DataSim$clone(deep = FALSE)
deep
Whether to make a deep clone.
MyClass <- R6::R6Class("MyClass",
inherit = DataSim,
public = list(),
private = list())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.