Purpose :
Clean, Join & Report Missingness
Define : What is my Data
Deliverable(s) :
Create Docu. for data
(data_dictionary.csv,README.md)
Create Dat. (cohorts.csv)
Create Report
(S10_Data_Cleaning.Rmd)
Meaning :
data_dictionary.csv : Defines each
variable in the final dataset, including its meaning, type, coding,
source, and missingness.
README.md : Summarizes the dataset,
its provenance, structure, limitations, access restrictions, and how to
use the project files.
cohorts.csv : Final cleaned and
de-identified analytic dataset used for analysis.
S10_Data_Cleaning.Rmd :
Reproducible record of how the raw data were cleaned, linked,
anonymized, validated, and converted into
cohorts.csv.
Source(s) of Guidance :
Data Privacy Statement :
Quarter : Fall (F), Winter (W), Spring (S)
Exam : Midterm (M), Final (F)
Version (VA, VB)
For example :
## [1] "First.Name" "Last.Name"
## [3] "SID" "Email"
## [5] "Sections" "Total.Score"
## [7] "Max.Points" "Status"
## [9] "Submission.ID" "Submission.Time"
## [11] "Lateness..H.M.S." "View.Count"
## [13] "Submission.Count" "X1..Question.1..1.0.pts."
## [15] "X2..Question.2..1.0.pts." "X3..Question.3..1.0.pts."
First.Name, Last.Name,
Submission.ID) & indirectly
(Sections, Email). Therefore we are to strip
that information to generate properly anonymized Data.n_rw <-
F_F_VA |> nrow() +
F_F_VB |> nrow() +
W_F_VA |> nrow() +
W_F_VB |> nrow() +
S_F_VA |> nrow() +
S_F_VB |> nrow()
paste0("Sum of all Rows = ", n_rw, " rows")## [1] "Sum of all Rows = 1520 rows"
# Comb. Versions
F_M <-
bind_rows(
F_M_VA |> mutate(version="A", recency = 3),
F_M_VB |> mutate(version="B", recency = 3)
)## [1] "818 rw for Fall Midterm"
## [1] "Therefore 0.54% (most) obs. are from Fall"
First.Name, Last.Name## [1] FALSE
## [1] FALSE
# make all upper
F_M <-
F_M |> mutate(
First.Name = toupper(First.Name),
Last.Name = toupper(Last.Name)
)
# toupper("a")
# rw id
F_M <- F_M |> mutate(rw_idx = row_number()) ## [1] TRUE
## [1] TRUE
First.Name, Last.Name pairs ct## [1] 301
## [1] 818
First.Name, Last.Name
pairs were observed.key_tbl_F_M# add unique std. id. for each unique FL-Name
key_tbl_F_M <-
F_M |>
distinct(First.Name, Last.Name) |>
mutate(std_id = paste0("student_", row_number()))
# Join std_id
F_M <-
F_M |>
left_join(
key_tbl_F_M,
by = c("First.Name", "Last.Name")
)student_110), one 216 times (student_40)## [1] 0.26
Notice some std. are so called UNIDENTIFIED STUDENT
(26%)
All students were graded
These students scores cannot be connected across exams