Description Usage Arguments Value References Examples
View source: R/as.data.frame.gapclosing.R
This function converts a gapclosing
object into a data frame. The gapclosing class contains results within a named list, thus simplifying things for manual user interaction with the results. In some programming settings (e.g. a bootstrap), it is easier to work with a rectangular data frame of results. This function produces that data frame.
1 2 | ## S3 method for class 'gapclosing'
as.data.frame(x, ...)
|
x |
Object of class |
... |
Additional arguments to be passed to or from methods. |
A data frame containing estimates.
Lundberg I (2021). "The gap-closing estimand: A causal approach to study interventions that close disparities across social categories." Sociological Methods and Research. Available at https://osf.io/gx4y3/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Simulate example data
simulated_data <- generate_simulated_data(n = 100)
# Fit by outcome modeling
estimate <- gapclosing(
data = simulated_data,
outcome_formula = formula(outcome ~ treatment * category + confounder),
treatment_name = "treatment",
category_name = "category",
counterfactual_assignments = 1
)
summary(estimate)
# Convert to a data frame
estimate.df <- as.data.frame(estimate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.