← All exercises · Download the Markdown source on GitHub

UMPD Data Exercise — Week of August 3, 2026 – August 9, 2026

Generated 2026-08-10. The data URL below is pinned to commit ec957153a, a snapshot of the dataset as of this exercise — so your numbers should match these exactly.

This week's numbers

Questions

  1. Write one sentence for a campus-news brief using the mean, and one using the median. Do they leave the reader with different impressions? Which is fairer?
  2. Rewrite the percent change above as a plain-language sentence a reader can check ("about X incidents a day, up from Y a year earlier"). Why might raw numbers serve readers better than percentages when counts are small?
  3. The Trends page compares semesters (Spring = Feb–Apr, Fall = Sep–Nov) instead of calendar quarters. What error does that choice avoid? What would a January-to-March "quarter" mix together on a university campus?
  4. In R, compute incidents per day for last week and for the same week last year, then the percent change between their means. Confirm you get the number printed above (both use round(x, 1)).

Starter code (R)

library(tidyverse)
library(lubridate)

activity <- read_csv("https://raw.githubusercontent.com/dwillis/umpd-logs/ec957153a614a913297b0c921303d222b45a55bb/data/all-police-activity.csv")

week_start <- ymd("2026-08-03")

daily <- activity |>
  mutate(day = as_date(`Date Occurred`)) |>
  filter(day >= week_start, day < week_start + days(7)) |>
  count(day, name = "incidents") |>
  complete(day = seq(week_start, week_start + days(6), by = "day"),
           fill = list(incidents = 0))

daily |>
  summarize(total = sum(incidents),
            mean_per_day = round(mean(incidents), 1),
            median_per_day = median(incidents))

Check your work

Your summarize() output should match "This week's numbers" above: total 7, mean 1.0, median 0. All values here use round(x, 1), which rounds halves to the nearest even digit — the same rule as R's round().

Stuck on the concepts? The site's Learn pages walk through every technique used here, with this same dataset.