Description Usage Arguments Details Value Author(s) Examples

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.

1 | ```
buildCaliper(data, treatment, ps.vars, group.id = NULL, caliper = 0.2)
``` |

`data` |
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. |

`treatment` |
Name of the treatment indicator. |

`ps.vars` |
Vector of names of variables to use in fitting the propensity score. |

`group.id` |
Name of group ID variable, if applicable. |

`caliper` |
Desired size of caliper, in number of standard deviations of the fitted propensity score. |

The `treatment`

variable should be binary with 1 indicating treated units and 0 indicating controls. When `group.id`

is `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, ljk20@psu.edu

Sam Pimentel, University of Pennsylvania, spi@wharton.upenn.edu

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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.