Learn R Programming

CIMTx (version 0.3.0)

data_gen: Data generation function

Description

This function generates data to test different causal inference methods.

Usage

data_gen(n, scenario, ratio, overlap, all_confounder)

Arguments

n

total number of units for simulation

scenario

simulation scenario 1 or scenario 2

ratio

ratio of units in the treatment groups

overlap

levels of covariate overlap: Please select: weak, strong, moderate

all_confounder

TRUE or FALSE. overlap is lacking for a variable that is not predictive of the outcome (all_confounder equals to TRUE) or situations when it is lacking for a true confounder (all_confounder equals to FALSE)

Value

list with the 5 elements. Nested within each list, it contains

n:

Number of units for simulation

trt_ind:

A data frame with number of rows equals to n and 11 columns

Y:

Observed binary outcome for 3 treatments

Yobs:

Observed binary outcome

Est:

True ATE/ATT for RD/RR/OR

Examples

Run this code
# NOT RUN {
library(CIMTx)
set.seed(3242019)
idata = data_gen(n = 120, ratio =1,scenario = 1)
# }

Run the code above in your browser using DataLab