← All exercises · Download the Markdown source on GitHub

UMPD Data Exercise — Week of August 10, 2026 – August 16, 2026

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

This week's numbers

Questions

  1. The mean and median daily counts above are different. Which days of last week pulled the mean away from the median? Run the starter code, look at the daily counts, and explain in two sentences which number you would put in a story.
  2. Careful: at least one of the two weeks being compared has fewer than 5 incidents (3 vs. 27). Explain in two sentences why the -88.9% figure above should NOT appear in a story, and what you would report instead.
  3. Using the percent change above: is this a real shift or ordinary week-to-week noise? The Learn page's spike detector uses mean ± 2 standard deviations of weekly counts as its "normal" band — compute that band in R (sd() on the weekly totals) and say whether last week falls outside it.
  4. A press release claims "campus crime fell 30% since 2020." Using what you know about 2020 (check the yearly chart on the Trends page), explain why that baseline is misleading — and what baseline you would use instead.
  5. In R, compute the mean and median incidents per day for each of the last four complete weeks (hint: floor_date(day, "week", week_start = 1) then group_by(week)). Is last week unusual among them?

Starter code (R)

library(tidyverse)
library(lubridate)

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

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

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 3, mean 0.4, 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.