Learn R Programming

CIMTx (version 0.3.0)

data_gen_p2: Data generation function for scenario 2 This function generates data to test different causal inference methods for scenario 2. Please use our main function data_gen.R

Description

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

Usage

data_gen_p2(n = 11600, p = 10, overlap = "weak", all_confounder = TRUE)

Arguments

n

total number of units for simulation

p

number of predictors

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)
data_gen_p2(n = 116, p =10, overlap = "weak", all_confounder = TRUE)
# }

Run the code above in your browser using DataLab