Skip to content

Instantly share code, notes, and snippets.

@carlislerainey
Created March 29, 2024 09:34
Show Gist options
  • Save carlislerainey/c084c5d94925412ead4e9537a5c1ba7a to your computer and use it in GitHub Desktop.
Save carlislerainey/c084c5d94925412ead4e9537a5c1ba7a to your computer and use it in GitHub Desktop.
Illustrate arm::display()
# load packages
library(tidyverse)
# update {crdata} if necessary
remotes::install_github("carlislerainey/crdata")
# load data
weis <- crdata::weisiger2014
# rescale weisiger2014 explanatory variables using arm::rescale()
rs_weis <- weis %>%
mutate(across(polity_conq:coord, arm::rescale))
# fit model
f <- resist ~ polity_conq + lndist + terrain + soldperterr + gdppc2 + coord
ls <- lm(f, data = rs_weis) # lpm (replicates Table 2 Model 3 of Weisiger 2014)
# display model fit
arm::display(ls, detail = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment