# Compute School Distance from a Student Match

### Description

Defines a distance between two schools whose students have been matched based on the size of the resulting matched sample and on the student-level covariate balance.

### Usage

1 | ```
match2distance(matchFrame, treatFrame, ctrlFrame, student.vars, treatment, largeval)
``` |

### Arguments

`matchFrame` |
dataframe containing all matched students. |

`treatFrame` |
dataframe containing all students from the treated school. |

`ctrlFrame` |
dataframe containing all students from the control school. |

`student.vars` |
names of variables on which to evaluate balance in the matched sample. Must be present in the column names of each of |

`treatment` |
name of the treatment variable. Must be present in the column names of each of |

`largeval` |
a large penalty value to be added to the distance for each student-level imbalance. |

### Details

The distance is computed by (1) subtracting the harmonic mean of the treated and control counts in the matched sample from `largeval`

(2) adding `largeval`

for each covariate among `studentvars`

that has an absolute standardized difference exceeding 0.2. This encourages the school match to choose larger schools with better balance.

### Value

a numeric distance.

### Author(s)

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

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