Takes a dataframe of student-level covariates and aggregates selected columns into a dataframe of school covariates.
students2schools(students, school.cov, school.id)
a dataframe of students.
a character vector of column names in
the name of the column in
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.
a dataframe of aggregated data, with one row for each school and columns in
Luke Keele, Penn State University, firstname.lastname@example.org
Sam Pimentel, University of Pennsylvania, email@example.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.