Learn R Programming

bartcs (version 1.3.0)

synthetic_data: Synthetic dataset for simulation

Description

Create synthetic dataset for simulation.

Usage

synthetic_data(N = 300, P = 100, seed = 42, binary_trt = TRUE)

Value

Provide list with the following components

Y

A vector of outcome values.

Trt

A vector of binary treatment values.

X

A matrix of potential confounders.

Arguments

N

Number of observations for dataset. The default value is set to 300.

P

Number of potential confounders for dataset. Need to set X > 7 for data generation. The default value is set to 100.

seed

Seed value for simulation. The default value is set to 42.

binary_trt

Whether the treatment is binary. The default value is set to TRUE.

Details

synthetic_data() generates synthetic dataset for Scenario 1 from Kim et al. (2023). Among possible confounders, X1 - X5 are true confounders.

References

Kim, C., Tec, M., & Zigler, C. M. (2023). Bayesian Nonparametric Adjustment of Confounding, Biometrics tools:::Rd_expr_doi("10.1111/biom.13833")

Examples

Run this code
synthetic_data()

Run the code above in your browser using DataLab