Learn R Programming

matchMulti (version 1.1.12.1)

matchStudents: Compute Student Matches for all Pairs of Schools

Description

Iterates over all possible treated-control school pairs, optionally computes and stores an optimal student match for each one, and generates a distance matrix for schools based on the quality of each student match.

Usage

matchStudents(
  students,
  treatment,
  school.id,
  match.students,
  student.vars,
  school.caliper = NULL,
  verbose,
  penalty.qtile,
  min.keep.pctg
)

Value

A list with two elements:

student.matches

a list with one element for each treated school. Each element is a list with one element for each control school, and each element of these secondary lists is a dataframe containing the matched sample for the corresponding treated-control pairing.

schools.matrix

a matrix with one row for each treated school and one column for each control school, giving matching distances based on the student match.

Arguments

students

a dataframe containing student covariates, with a different row for each student.

treatment

the column name of the binary treatment status indicator in the students dataframe.

school.id

the column name of the unique school ID in the students dataframe.

match.students

logical value. If TRUE, students are matched within school pairs and some students will be excluded. If FALSE, all students will be retained in the matched sample for each school pair.

student.vars

column names of variables in students on which to match students and assess balance of student matches in evaluating match quality.

school.caliper

matrix with one row for each treated school and one column for each control school, containing zeroes for pairings allowed by the caliper and Inf values for forbidden pairings. When NULL no caliper is imposed.

verbose

a logical value indicating whether detailed output should be printed.

penalty.qtile

a numeric value between 0 and 1 specifying a quantile of the distribution of all student-student matching distances. The algorithm will prefer to exclude treated students rather than form pairs with distances exceeding this quantile.

min.keep.pctg

a minimum percentage of students in the smaller school in a pair which must be retained, even when treated students are excluded.

Author

Luke Keele, Penn State University, ljk20@psu.edu

Sam Pimentel, University of California, Berkeley, spi@berkeley.edu

Details

The penalty.qtile and min.keep.pctg control the rate at which students are trimmed from the match. If the quantile is high enough no students should be excluded in any match; if the quantile is very low the min.keep.pctg can still ensure a minimal sample size in each match.