11.15 Chapter 11 Review Questions 2

Audiences love disaster movies in which the world ends and a hero saves the day. But how scared are people, really, of natural disasters?

In 2015, when the earthquake disaster movie "San Andreas" came out, the news website FiveThirtyEight commissioned a poll to survey participants about their fears, experience, and knowledge of earthquakes, in addition to collecting demographic information related to age, gender, region, and household income. The san_andreas data frame is a modified version of the results of this survey.

The san_andreas data frame consists of 978 responses to the following survey items:

  • worry_general In general, how worried are you about earthquakes? (measured on a 5-item scale from 1 to 5, with 5 being most worried)
  • worry_bigone How worried are you about the "Big One," a massive, catastrophic earthquake? (measured on a 5-item scale from 1 to 5, with 5 being most worried)
  • will_occur Do you think the "Big One" will occur in your lifetime? (true = yes, false = no)
  • experience Have you ever experienced an earthquake? (no; yes, one or more minor ones; yes, one or more major ones)
  • prepared Have you or anyone in your household taken any precautions for an earthquake (packed an earthquake survival kit, prepared an evacuation plan, etc.)? (true = yes, false = no)
  • fam_san_andreas How familiar are you with the San Andreas Fault line? (measured on a 5-item scale from "not at all familiar" to "extremely familiar")
  • fam_yellowstone How familiar are you with the Yellowstone Supervolcano? (measured on a 5-item scale from "not at all familiar" to "extremely familiar")
  • female Gender (true = female; false = male)
  • region US Region (region of the United States in which the participant lives)
  • age Age (in years)
  • income total household income (in thousands of dollars)

require(coursekata) link <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vSZozH-r8y8XkIQ71eLTKL94R8Unkw41KqCJFmbvRlU-jcphybc4X_WVNZTvAH1_-4l4tx7wWSIH0Rk/pub?output=csv" san_andreas <- read.csv(link, header=TRUE) san_andreas$experience <- as.factor(san_andreas$experience) san_andreas$will_occur <- as.factor(san_andreas$will_occur) san_andreas$worry_general <- recode(san_andreas$worry_general, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$worry_bigone <- recode(san_andreas$worry_bigone, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$experience <- factor(san_andreas$experience, levels = c("No", "Yes, one or more minor ones", "Yes, one or more major ones")) san_andreas <- na.omit(san_andreas) # run your code here
require(coursekata) link <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vSZozH-r8y8XkIQ71eLTKL94R8Unkw41KqCJFmbvRlU-jcphybc4X_WVNZTvAH1_-4l4tx7wWSIH0Rk/pub?output=csv" san_andreas <- read.csv(link, header=TRUE) san_andreas$experience <- as.factor(san_andreas$experience) san_andreas$will_occur <- as.factor(san_andreas$will_occur) san_andreas$worry_general <- recode(san_andreas$worry_general, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$worry_bigone <- recode(san_andreas$worry_bigone, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$experience <- factor(san_andreas$experience, levels = c("No", "Yes, one or more minor ones", "Yes, one or more major ones")) san_andreas <- na.omit(san_andreas) # Box Plots and Histograms gf_boxplot(worry_bigone ~ experience, data = san_andreas) gf_histogram(~worry_bigone, data = san_andreas, bins = 5) %>% gf_facet_grid(experience~.) # Write some code to fit and save exp_model
require(coursekata) link <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vSZozH-r8y8XkIQ71eLTKL94R8Unkw41KqCJFmbvRlU-jcphybc4X_WVNZTvAH1_-4l4tx7wWSIH0Rk/pub?output=csv" san_andreas <- read.csv(link, header=TRUE) san_andreas$experience <- as.factor(san_andreas$experience) san_andreas$will_occur <- as.factor(san_andreas$will_occur) san_andreas$worry_general <- recode(san_andreas$worry_general, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$worry_bigone <- recode(san_andreas$worry_bigone, "Not at all worried" = 1, "Not so worried" = 2, "Somewhat worried" = 3, "Very worried" = 4, "Extremely worried"= 5) san_andreas$experience <- factor(san_andreas$experience, levels = c("No", "Yes, one or more minor ones", "Yes, one or more major ones")) san_andreas <- na.omit(san_andreas) exp_model <- lm(worry_bigone ~ experience, data = san_andreas) # Run this code pairwise(exp_model)

Responses