Skip to content

Instantly share code, notes, and snippets.

@carlislerainey
Last active August 29, 2015 14:06
Show Gist options
  • Save carlislerainey/4e5ebb2ac530809ce88f to your computer and use it in GitHub Desktop.
Save carlislerainey/4e5ebb2ac530809ce88f to your computer and use it in GitHub Desktop.
Replicate Fearon and Laitin (2003) (Table 1, Model 1)
# load packages
library(foreign) # for read.dta()
library(arm) # for display()
# load data
fl <- read.dta("http://crain.co/am-files/data/fearon-laitin.dta")
# something weird is going on
table(fl$onset) # wtf?
fl$onset[fl$onset == 4] <- 1 # recode weird case
# estimate model
m <- glm(onset ~ warl + gdpenl + lpopl1 +
lmtnest + ncontig + Oil + nwstate +
instab + polity2l + ethfrac + relfrac,
family = binomial, data = fl)
# display estimates
display(m) # replicated!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment