Purpose : Statistically investigate exam performance. Discover underlying patterns on exams. Criteria for category of problems wrong.

rm(list=ls())
getwd()
## [1] "/Users/isaiahmireles"
cohorts <- read.csv("Desktop/Misconceptions/cohorts.csv")

1 Data Docu

  • Exams vary in length

2 Student term Count (ct)

library(tidyverse)
cohorts |> group_by(term) |> summarize(ct = n())

3 Exam Q Count (ct)

question_counts <- cohorts |>
  pivot_longer(
    cols = starts_with("Q"),
    names_to = "question",
    values_to = "score"
  ) |>
  group_by(term, exam, question) |>
  summarize(
    question_exists = any(!is.na(score)),
    .groups = "drop"
  ) |>
  filter(question_exists) |>
  count(term, exam, name = "n_questions")

question_counts

4 Data Structure

library(DiagrammeR)

grViz("
digraph cohorts_structure {

  graph [
    layout = dot,
    rankdir = TB
  ]

  node [
    shape = box,
    style = rounded,
    fontname = Helvetica,
    fontsize = 12,
    width = 1.7,
    height = 0.7
  ]

  edge [
    arrowhead = normal,
    color = black
  ]

  study [label = 'STUDY']

  f23 [label = 'F23']
  w24 [label = 'W24']
  s24 [label = 'S24']

  f23_students [label = 'Students']
  w24_students [label = 'Students']
  s24_students [label = 'Students']

  f23_mid [
    label = 'Midterm\\nN = 513'
  ]

  f23_final [
    label = 'Final\\nN = 294'
  ]

  w24_mid [
    label = 'Midterm\\nN = 297'
  ]

  w24_final [
    label = 'Final\\nN = 291'
  ]

  s24_mid [
    label = 'Midterm\\nN = 149'
  ]

  s24_final [
    label = 'Final\\nN = 146'
  ]

  f23_mid_items [
    label = 'Items\\nQ1–Q34\\n34 items'
  ]

  f23_final_items [
    label = 'Items\\nQ1–Q31\\n31 items'
  ]

  w24_mid_items [
    label = 'Items\\nQ1–Q33\\n33 items'
  ]

  w24_final_items [
    label = 'Items\\nQ1–Q32\\n32 items'
  ]

  s24_mid_items [
    label = 'Items\\nQ1–Q34\\n34 items'
  ]

  s24_final_items [
    label = 'Items\\nQ1–Q32\\n32 items'
  ]

  study -> f23
  study -> w24
  study -> s24

  f23 -> f23_students
  w24 -> w24_students
  s24 -> s24_students

  f23_students -> f23_mid
  f23_students -> f23_final

  w24_students -> w24_mid
  w24_students -> w24_final

  s24_students -> s24_mid
  s24_students -> s24_final

  f23_mid -> f23_mid_items
  f23_final -> f23_final_items

  w24_mid -> w24_mid_items
  w24_final -> w24_final_items

  s24_mid -> s24_mid_items
  s24_final -> s24_final_items

  {rank = same; f23; w24; s24}

  {rank = same;
    f23_students;
    w24_students;
    s24_students
  }

  {rank = same;
    f23_mid;
    f23_final;
    w24_mid;
    w24_final;
    s24_mid;
    s24_final
  }

  {rank = same;
    f23_mid_items;
    f23_final_items;
    w24_mid_items;
    w24_final_items;
    s24_mid_items;
    s24_final_items
  }
}
")
library(tidyverse)