Learn R Programming

CIMTx (version 0.3.0)

data_gen_p1: Data generation function for scenario 1

Description

This function generates data to test different causal inference methods for scenario 1. Please use our main function data_gen.R

Usage

data_gen_p1(n = 11600, ratio = 3, all_confounder = FALSE)

Arguments

n

total number of units for simulation

ratio

ratio of units in the treatment groups

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)
data_gen_p1(n = 116, ratio = 3,all_confounder=FALSE)
# }

Run the code above in your browser using DataLab