students2schools: Aggregate Student Data into School Data

View source: R/matchMulti-internal.R

students2schoolsR Documentation

Aggregate Student Data into School Data

Description

Takes a dataframe of student-level covariates and aggregates selected columns into a dataframe of school covariates.

Usage

students2schools(students, school.cov, school.id)

Arguments

students

a dataframe of students.

school.cov

a character vector of column names in students that should be aggregated by school.

school.id

the name of the column in students containing the unique school identifier.

Details

Aggregation is either done by taking averages or by selecting the unique factor value when a school has only one value for a factor. As a result, school.covs should only include variables that are numeric or do not vary within schools.

Value

a dataframe of aggregated data, with one row for each school and columns in school.covs and school.id.

Author(s)

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

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


matchMulti documentation built on May 31, 2023, 9:13 p.m.