Learn R Programming

MatchingFrontier (version 1.0.0)

generateDataset: Generate a data set that is on the balance - sample size frontier.

Description

generateDataset() allows the user to export a data set that sits on the frontier.

Usage

generateDataset(frontier.object, N)

Arguments

frontier.object
An object generated by makeFrontier().
N
The number of observations left in the exported data set. If the user selects an undefined point, generateDataset returns a dataset from the nearest defined point on the frontier.

References

King, Gary, Christopher Lucas, and Richard Nielsen. "The Balance-Sample Size Frontier in Matching Methods for Causal Inference." (2015).

Examples

Run this code
data(lalonde)

match.on <- colnames(lalonde)[!(colnames(lalonde) %in% c('re78', 'treat'))]
my.frontier <- makeFrontier(dataset = lalonde,
                            treatment = 'treat',
                            outcome = 're78',
                            match.on = match.on)
n <- 300 # Identify the point from which to select the data
matched.data <- generateDataset(my.frontier, N = n)

Run the code above in your browser using DataLab