Lab 5

Central tendency over space

Instructions

Complete the following assignment using a word processing program, the R Project for Statistical Computing, and (potentially) a GIS of your choice. When you are finished, upload your work (.pdf file only) to the dropbox on Canvas.

In this lab, you will calculate the geographic mean center of population in Wisconsin for two different years (2000 and 2022) using two different methods (unweighted and weighted).

Data preparation

Use the following R script to prepare the data. You will have to fill in the missing pieces (noted by multiple consecutive underscores).

library(tidycensus)
library(sf)
library(dplyr)

## be sure to load your census api key here if you are doing this on a new
## computer
#census_api_key(____)

## get data from decennial census with the appropriate function here
wi_2000 <- ____(geography = "county",
                state = __,
                variables = c(pop2000 = "H010001"),
                geometry = TRUE,
                year = ____,
                output = "wide")

## get data from acs with the appropriate function here
wi_2022 <- ____(geography = "county",
                state = __,
                variables = c(pop2022 = "B01003_001"),
                year = ____,
                geometry = FALSE,
                output = "wide")

## join tables
wi_data <- left_join(____, ____, by = "GEOID") %>%
  ## remove duplicated column names
  select(-c(NAME.y, pop2022M)) %>%
  ## rename columns to make them easier to work with
  rename(NAME = NAME.x,
         pop2022 = pop2022E) %>%
  # rearrange columns in a useful order
  relocate(GEOID, NAME, pop2000, pop2022)

## calculate population change
_____ <- _____

## write data as geopackage; NOTE: if you plan to use R to make the maps, you do
## not need to complete this step
st_write(wi_data, ____, delete_layer = TRUE)

#### to complete on your own (in R or a desktop GIS): ####

## calculate (unweighted) mean center of the state

## calculate weighted mean center of the state in 2000 population

## calculate weighted mean center of the state in 2022 population

## make maps

Questions

  1. Compute the following and create a single map with a CRS appropriate for Wisconsin that clearly and distinctly identifies each of the following (3 pts.):

    • Unweighted mean center
    • Weighted mean center (by 2000 population)
    • Weighted mean center (by 2022 population)
  2. Create another map showing the change in population for each county from 2000 to 2022 (1 pt.).

  3. Discuss why a shift in the weighted mean center has (or hasn’t) occurred, the direction of the change (if there is one), and what is driving this change (or what is providing stability). (4+ sentences) (4 pts.).