-
Notifications
You must be signed in to change notification settings - Fork 1
/
degree.R
73 lines (70 loc) · 2.78 KB
/
degree.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Documentation described below using an inline R code chunk, e.g.,
# "`r var_mcid`" or "`r var_institution`", are documented in the
# R/roxygen.R file.
#' Student-level degree data
#'
#' Student-level degree information for approximately 50,000 undergraduates
#' earning degrees, keyed by student ID. Data at the "student-level" refers to
#' information collected by undergraduate institutions about individual
#' students, for example, institution, program, term, and baccalaureate degree.
#'
#' Degree data are structured in block-record form, that is, records associated
#' with a particular ID can span multiple rows---one record per student per
#' degree. Multiple degrees can occur in the same term or in different terms.
#'
#' Terms are encoded `YYYYT`, where `YYYY` is the year at the start of the
#' academic year and `T` encodes the semester or quarter within an academic year
#' as Fall (`1`), Winter (`2`), Spring (`3`), and Summer (`4`, `5`, and `6`).
#' For example, for academic year 1995--96, Fall 95--96 is encoded `19951`,
#' Spring 95--96 is encoded `19953`, and the first Summer 95-96 term is encoded
#' `19954`. The source database includes special month-long sessions encoded
#' with letters `A`, `B`, `C`, etc., though none are included in this sample.
#'
#' For program codes, `midfielddata` uses the 2010 version of the Classification
#' of Instructional Programs (CIP). If the `midfieldr` package is installed and
#' loaded, type `?cip` for details.
#'
#' The data in `midfielddata` are a proportionate stratified sample of the
#' MIDFIELD database, but are not suitable for drawing inferences about program
#' attributes or student experiences---`midfielddata` provides practice data,
#' not research data.
#'
#' @name degree
#' @docType data
#' @family datasets
#' @keywords datasets
#' @source 2022 [MIDFIELD](https://midfield.online/) database
#' @seealso Package [`midfieldr`](https://midfieldr.github.io/midfieldr/)
#' for tools and methods for working with MIDFIELD data in `R`.
#'
#' @usage data(degree)
#'
#' @format A `data.frame` and `data.table` with 5 variables and 49,543
#' observations of unique students occupying 6 MB of memory:
#'
#' \describe{
#' \item{`mcid`}{`r var_mcid`}
#' \item{`institution`}{`r var_institution`}
#' \item{`term_degree`}{`r var_term_degree`}
#' \item{`cip6`}{`r var_cip6_degree`}
#' \item{`degree`}{Character, type of degree awarded, e.g.,
#' `Bachelor of Arts in Geography`, `Bachelor of Science in Finance`,
#' etc.}
#' }
#'
#' @examples
#' \dontrun{
#'
#' # Load data
#' data(degree)
#'
#' # Select specific rows and columns
#' rows_we_want <- degree$mcid == MCID3112192438
#' cols_we_want <- c(mcid, term_degree, cip6, degree)
#'
#' # View observations for this ID
#' degree[rows_we_want, cols_we_want]
#'
#' }
#'
NULL