# ferdo R Lab | Lesson 3 | Student TODO practice
# All data fictional. Keep original CSV unchanged.
stopifnot(file.exists("data/class_synthetic.csv"))
d <- read.csv("data/class_synthetic.csv",
              na.strings=c("","NA"), stringsAsFactors=FALSE)
d$group <- factor(d$group, levels=c("A","B"))

# TODO 1: Create a new data frame of group B rows with observed scores.

# TODO 2: List IDs with quiz_score > 75, safely excluding missing scores.

# TODO 3: Show group frequencies and proportions.

# TODO 4: Compare tapply(mean) and aggregate(mean) output types.

# TODO 5: Count observed (non-NA) quiz scores by group.

# TODO 6: Compute per-group fraction of observed scores >= 70.
# Write out which denominator you chose and why.

# TODO 7: Compare group scores when requiring complete study_hours
# and quiz_score pairs. Explain any changed group mean.

# TODO 8: Plot mean quiz_score by group; describe limitations.

# TODO 9: Build a 3-column summary: group, valid_n, mean_score.

# TODO 10: Write two English sentences, one factual and one
# about the limitations of fictional, small, incomplete data.
