agg: Extract School-Level Covariates

View source: R/matchMulti-internal.R

aggR Documentation

Extract School-Level Covariates

Description

Given a vector of variables of interest for students in a single school, extracts a single value for the school

Usage

agg(x)

Arguments

x

a vector containing student-level observations for a school. If it is a factor it must contain only a single level.

Details

If the input is numeric, agg returns the mean; if the input is not numeric, an error will be thrown unless all values are the same, in which case the single unique value will be returned.

Value

A single value of the same type as the input vector.

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.