Construct propensity score caliper
Fits a propensity score for an individual-level or group-level treatment, computes a caliper for the propensity score (based on a fractional number of standard deviations provided by the user), and creates a matrix containing information about which treated-control pairings are excluded by the caliper.
A data frame containing the treatment variable, the variables to be used in fitting the propensity score and (if treatment is at the group level) a group ID.
Name of the treatment indicator.
Vector of names of variables to use in fitting the propensity score.
Name of group ID variable, if applicable.
Desired size of caliper, in number of standard deviations of the fitted propensity score.
treatment variable should be binary with 1 indicating treated units and 0 indicating controls. When
NULL, treatment is assumed to be at the individual level and the propensity score is fitted using the matrix
data. When a group ID is specified, data frame
data is first aggregated into groups, with variables in
ps.vars replaced by their within-group means, and the propensity score is fitted on the group matrix.
A matrix with
nrow equal to the number of treated individuals or groups and
ncol equal to the number of control individuals, with
0 entries indicating pairings permitted by the caliper and
Inf entries indicating forbidden pairings.
Luke Keele, Penn State University, email@example.com
Sam Pimentel, University of Pennsylvania, firstname.lastname@example.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
## Not run: # Load Catholic school data data(catholic_schools) student.cov <- c('minority','female','ses','mathach') # Check balance student balance before matching balanceTable(catholic_schools[c(student.cov,'sector')], treatment = 'sector') #fit a propensity score caliper on mean values of student covariates within schools school.caliper <- buildCaliper(data = catholic_schools, treatment = 'sector', ps.vars = student.cov, group.id = 'school') #Match schools but not students within schools match.simple <- matchMulti(catholic_schools, treatment = 'sector', school.caliper = school.caliper, school.id = 'school', match.students = FALSE) #Check balance after matching - this checks both student and school balance balanceMulti(match.simple, student.cov = student.cov) ## End(Not run)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.