Provides a means of excluding post-baccalaureate terms by adding a column of term-status labels identifying pre- and post-baccalaureate terms.
Value
A data frame with the following properties: rows
are preserved; columns first_degree_term and term_status are added
or overwritten; all other columns are preserved.
Grouping structures are not necessarily preserved.
The added columns are:
first_degree_termCharacter. Term of a student's first baccalaureate, encoded
YYYYT— or NA if no degree recorded.term_statusCharacter. Possible values are "pre-bacc", "first-degree", and "post-first-degree".
An attempt is made to return data frames of the same class as the input, so a data.table input should produce a data.table output, a tibble input should produce a tibble output, etc. Grouped tibbles, however, are returned as data.frames. To help ensure a tibble output, try ungrouping a tibble before using it as an input argument.
Details
In a typical analysis, one is interested in a student's progress up to and including the term in which they earn their first degree or degrees. Any terms later than the first baccalaureate can usually be excluded from study.
The input dframe must have a term variable with one of three possible
names: term (from the term data table), term_course (from the course
data table), or term_degree (from the degree data table).
add_post_bacc() determines a student's first degree term (if any)
from midfield_degree, adds that column to dframe, and adds a second
column of term-status labels identifying pre- and post-baccalaureate terms.