Data :
Midterms/Finals Exam Performance : Fall (2023), Winter (2024), Spring (2024)
Spring 2024 includes specific inf. regarding which MCQ response a student chose (e.g. A, B, C, D)
Others : Inc. only binary resp (1 – correct, 0 – incorrect)
Objective : Data Cleaning & Preperation
setwd("/Users/isaiahmireles/Desktop/Misconceptions")
# Midterm :
# F23
F23_M_VA <-
read.csv("F23_Midterm_Version_Set_Scores/Midterm_Version_A_scores.csv")
F23_M_VB <-
read.csv("F23_Midterm_Version_Set_Scores/Midterm_Version_B_scores.csv")
# W24
W24_M_VA <-
read.csv("W24_Midterm_Version_Set_Scores/Midterm_Version_A_scores.csv")
W24_M_VB <-
read.csv("W24_Midterm_Version_Set_Scores/Midterm_Version_B_scores.csv")
# S24
S24_M <-
read.csv("24S-STATS-10-LEC-4_Midterm/S24_Midterm_student_responses copy.csv")
# ------------------------------------------------------------------------------- #
# Final :
# F23
F23_F_VA <-
read.csv("F23_Final_Exam_Version_Set_Scores/Final_Exam_Version_A_scores.csv")
F23_F_VB <-
read.csv("F23_Final_Exam_Version_Set_Scores/Final_Exam_Version_B_scores.csv")
# W24
W24_F_VA <-
read.csv("W24_Final_Exam_Version_Set_Scores/Final_Exam_Version_A_scores.csv")
W24_F_VB <-
read.csv("W24_Final_Exam_Version_Set_Scores/Final_Exam_Version_B_scores.csv")
# S24
S24_F_VA <-
read.csv("S24_Final_Exam_Version_Set_Scores/Final_Exam_Version_A_scores.csv")
S24_F_VB <-
read.csv("S24_Final_Exam_Version_Set_Scores/Final_Exam_Version_B_scores.csv")Roughly, how many students all together?
n_std_F <-
F23_F_VA |> nrow() + F23_F_VB |> nrow() + W24_F_VA |> nrow() + W24_F_VB |> nrow() + S24_F_VA |> nrow() + S24_F_VB |> nrow()
n_std_F## [1] 1520
## [1] 301
## [1] 420
# which idx ?
idx_v <-
F23_M_VA |>
mutate(idx = row_number()) |>
group_by(SID) |>
filter(n() > 1) |>
ungroup() |> # tell SID to f-off
pull(idx) # make it into a vec.
# damn
F23_M_VA[idx_v,] |> nrow()## [1] 121
problem(s) :
There are many “unidentified student”
one named/identified repeated obs.
## Total.Score
## 1 32
## 2 29
## 3 31
## 4 27
## 5 13
## 6 23
## 7 17
## 8 30
## 9 25
## 10 33
## 11 34
## 12 18
## 13 26
## 14 21
## 15 22
## 16 16
## 17 24
## 18 15
## 19 28
## 20 19
## 21 20
## 22 NA
# ------------------------------------------------------------------------------- #
F23_F_VA |> distinct(SID) |> nrow()## [1] 300
## [1] 301
# which idx ?
idx_v <-
F23_F_VA |>
mutate(idx = row_number()) |>
group_by(SID) |>
filter(n() > 1) |>
ungroup() |> # tell SID to f-off
pull(idx) # make it into a vec.
# F23_F_VA[idx_v,] |> select(SID, First.Name, Last.Name)
# ------------------------------------------------------------------------------- #
F23_F_VB |> distinct(SID) |> nrow()## [1] 300
## [1] 301
# Put the raw Fall 2023 data frames into a list.
F23_raw_lst <- list(
F23_F_VA = F23_F_VA,
F23_M_VA = F23_M_VA,
F23_M_VB = F23_M_VB,
F23_F_VB = F23_F_VB
)
# Create one unique student ID mapping across all Fall 2023 data.
F23_student_key <- F23_raw_lst |>
bind_rows() |>
distinct(SID) |>
mutate(
student = paste0("student_", row_number())
)
# Add the same student ID mapping to every data frame.
F23_lst <- F23_raw_lst |>
map(
\(df) {
df |>
left_join(F23_student_key, by = "SID") |>
select(-c(First.Name, Last.Name, SID, Email, Submission.ID))
}
)