DataSimClass: R6 Data Generating Parent Class

DataSimR Documentation

R6 Data Generating Parent Class

Description

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.

Value

An R6 object

Methods

Public methods


DataSim$get_x()

Gets the covariate data

Usage
DataSim$get_x()

DataSim$get_y()

Gets the outcome vector

Usage
DataSim$get_y()

DataSim$get_z()

Gets the treatment indicator

Usage
DataSim$get_z()

DataSim$get_n()

Gets the number of observations

Usage
DataSim$get_n()

DataSim$get_x1()

Gets the covariate data for the treated individuals

Usage
DataSim$get_x1()

DataSim$get_x0()

Gets the covaraiate data for the control individuals

Usage
DataSim$get_x0()

DataSim$get_p()

Gets the dimensionality covariate data

Usage
DataSim$get_p()

DataSim$get_tau()

Gets the individual treatment effects

Usage
DataSim$get_tau()

DataSim$gen_data()

Generates the data. Default is an empty function

Usage
DataSim$gen_data()

DataSim$clone()

The objects of this class are cloneable with this method.

Usage
DataSim$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

MyClass <- R6::R6Class("MyClass", 
inherit = DataSim,
public = list(),
private = list())

causalOT documentation built on Nov. 24, 2026, 1:06 a.m.