uth_make_outcome_rate: uth_make_outcome_rate

View source: R/uth_make_outcome_rate.R

uth_make_outcome_rateR Documentation

uth_make_outcome_rate

Description

Use this function to aggregate counts and totals to then make rates in a data frame. A typical use case would involve a data frame with student ids, a Boolean variable to make a rate such as is_returned_next_fall or Is_graduated, as well as a collection of grouping attributes.

Usage

uth_make_outcome_rate(.data, rate_var, ...)

Arguments

.data

A data frame with columns you would like to aggregate on.

rate_var

A Boolean variable to make a rate such as is_returned_next_fall or Is_graduated. This must be the 2nd argument used in the function or must be hard coded as rate_var = .

...

The columns you would like to aggregate over. Don't forget the column you are counting, i.e. student number. all the grouping variables for a given metric. this can be a variables in "quotes" separated by commas or be it can be variables defined in a named list.

Example uses:

'uth_make_outcome_rate(.data = grad_data_raw, rate_var = “is_graduated”, “cohort_start_term_id”, “gender_code”)

grouping_list <- c(“cohort_start_term_id”, “gender_code”, “cohort_code_desc”)

uth_make_outcome_rate(grad_data_raw, “is_graduated”, grouping_list)

Value

A table with aggregated counts, totals, and rates of column attributes

Examples

utHelpR::uth_make_outcome_rate(fake_enrollment, "is_graduated", "gender_code", "primary_degree_id")
utHelpR::uth_make_outcome_rate(fake_enrollment, "is_returned_next_fall", "student_type_code")

dsu-effectiveness/utHelpR documentation built on April 26, 2024, 12:24 p.m.