Lab 3

Central tendency and distribution shape

Objectives

  • Use measures of central tendency
  • Create visualizations
  • Dissect code that was used to retrieve data and conduct background research to uncover which census products were used in data creation
  • Relate measures of central tendency to distribution shape

What to upload

  • A .pdf containing all of the answers to the questions in this lab
  • An R script which contains the code you used to create visualizations and descriptive statistics

Data preparation

Use the following code to retrieve the county level ACS data in Wisconsin (with spatial features) that will be used in the lab by modifying the underscores (i.e., _____) :

library(tidycensus)
library(dplyr)
library(readr)

wi_vars <- get_acs(geography = _____,
                   variables = c(_____ = "B19013_001",
                                 _____ = "B01002_001"),
                   state = _____,
                   output = _____,
                   year = 2022,
                   _____ = TRUE)

wi_vars <- wi_vars %>%
  transmute(GEOID,
            NAME,
            income = incomeE,
            age = ageE)

Questions

  1. Which year, census product, and estimate (e.g., 1-year, 3-year, or 5-year) correspond to the variables income and age?

  2. What is the scale of measurement for the variable income? Explain your answer.

  3. What is the scale of measurement for the variable age? Explain your answer.

  4. What are the assumptions associated with computing basic descriptive statistics like central tendency and shape? Do the variables income and age fulfill these assumptions?

  5. Create a visualization for the distribution of the variable income. Include it in your document.

  6. Create a visualization for the distribution of the variable age. Include it in your document.

  7. Compute the mean, median, and mode(s) for the variable income.

  8. Discuss the shape of the distribution for the variable income in relation to its measures of central tendency.

  9. Compute the mean, median, and mode(s) for the variable age.

  10. Discuss the shape of the distribution for the variable age in relation to its measures of central tendency.