Calculates the share of students (overall or by subgroup) attending schools that meet or exceed a performance threshold. This replicates the MarGrady metric: "the share of Black students in Newark attending a school that beat the state proficiency average."
Arguments
- df_enrollment
School-level enrollment data with demographic counts
- df_performance
School-level performance data
- performance_metric
Character. Column in df_performance to use as the performance measure. Default "proficient_above".
- threshold_type
Character. How to define "high-performing":
"state_avg": Above the state average for that year/grade/subject
"absolute": Above a fixed numeric threshold
"percentile": Above a percentile threshold within peers
- threshold_value
Numeric. The threshold value. Required for "absolute" and "percentile" types. For "state_avg", this is ignored.
- enrollment_col
Character. Column in df_enrollment containing student counts. Default "n_students".
- subgroup
Character. Which subgroup to calculate access for. If NULL, calculates for total enrollment. Default NULL.
- join_cols
Character vector. Columns to join enrollment and performance data on. Default c("end_year", "county_id", "district_id", "school_id").