Background

Computed for Zeke Jeffrey. Data is from UV county paper.

Init

options(digits = 2)
library(pacman)
p_load(kirkegaard, rms)
theme_set(theme_bw())

Data

d = read_rds("data/data_out_counties.rds")

#rename
d %<>% mutate(
  violent_crime = Violent.crime %>% standardize(),
  poverty_rate = Poverty.Rate.below.federal.poverty.threshold %>% standardize(),
)

Regressions

list(
  ols(violent_crime ~ poverty_rate, data = d, weights = d$Total.Population %>% sqrt()),
  ols(violent_crime ~ poverty_rate + Black, data = d, weights = d$Total.Population %>% sqrt()),
  ols(violent_crime ~ poverty_rate + Black + Hispanic + Asian + Amerindian + Other, data = d, weights = d$Total.Population %>% sqrt()),
  ols(violent_crime ~ poverty_rate + Black + Hispanic + Asian + Amerindian + Other + CA, data = d, weights = d$Total.Population %>% sqrt())
) %>% 
  summarize_models()