gen_data: Generate Toy Data for Matching

Description Usage Arguments Details Value

View source: R/gen_data.R

Description

gen_data generates toy data that can be used to explore FLAME and DAME functionality.

Usage

1
gen_data(n = 250, p = 5, write = FALSE, path = getwd(), filename = "AME.csv")

Arguments

n

Number of units desired in the data set. Defaults to 250.

p

Number of covariates in the data set. Must be greater than 2. Defaults to 5.

write

A logical scalar. If TRUE, the resulting data is stored as a .csv file as specified by arguments path and filename. Defaults to FALSE.

path

The path to the location where the data should be written if write = TRUE. Defaults to getwd().

filename

The name of the file to which the data should be written if write = TRUE. Defaults to AME.csv.

Details

gen_data simulates data in the format accepted by FLAME and link{DAME}. Covariates X_i and treatment T are both independently generated according to a Bernoulli(0.5) distribution. The outcome Y is generated according to Y = 15X_1 - 10X_2 + 5X_3 + 5T + ε, where ε \sim N(0, I_n). Thus, the value of p must be at least 3 and any additional covariates beyond X_1, X_2, X_3 are irrelevant.

Value

A data frame that may be passed to FLAME or DAME. Covariates are numeric, treatment is binary numeric and outcome is numeric.


FLAME documentation built on Dec. 11, 2021, 9:26 a.m.