Case Studies

Case study 1

We will be using data from the World Happiness Report for this case study.

If you have already set the data up, then you can reuse the project you had going.

library(tidyverse)
happiness <- read_csv("data/world-happiness-2020-2024.csv")

Questions

What questions can we answer with regression and this data set?

Case Study 2

Download the .csv file on Automobiles Annual Imports and Exports

There are spaces in the column names, so we need to make sure the names are clean (easier to type). We will load the janitor library and then use clean_names()

library(janitor)

automobile_import_export <- read_csv("data/Automobiles_Annual_Imports_and_Exports_Through_Port_Authority_of_NY_NJ_Maritime_Terminals__Beginning_2000.csv") |>
  clean_names()

Question 1

What is the effect of type (imports vs. exports) on number of cars?

To answer this question follow these steps:

  1. Run linear regression (lm()) with automobile_volume as the response variable
  2. Plot the effects
  3. Write up a paragraph on your findings/answer the question

Gradescope questions

Answer these questions about the results for question 1 on Gradescope

Question 2

What is the effect of year on number of cars being imported and exported?

To answer this question follow these steps:

  1. Run linear regression (lm()) with automobile_volume as the response variable
  2. Plot the effects
  3. Write up a paragraph on your findings/answer the question

Case Study 3

Download this clean data set on percentage of health conditions among children under age 18 and set up the data in your analysis environment.

What questions can you answer with this data set?