Skip to content

Instantly share code, notes, and snippets.

@carlislerainey
Created October 15, 2014 17:43
Show Gist options
  • Save carlislerainey/0df07183e5b924c2674a to your computer and use it in GitHub Desktop.
Save carlislerainey/0df07183e5b924c2674a to your computer and use it in GitHub Desktop.
Estimate an ordered probit model.
# replication of Hill, Moore, and Mukherjee (2013)
# load packages
library(arm)
# load data
d <- read.csv("http://crain.co/am-files/data/hmm.csv")
# examine data
names(d)
xtabs(~ d$tort)
# make tort and *ordered factor*
d$tort <- as.ordered(d$tort)
# create variable
d$logHROsec <- log(1 + d$HROsecretariatlocation)
# estimate the ordered probit
m <- polr(tort ~ logHROsec + WoverS + cat_rat + allterror + lngdp + lnpop,
data = d, method = "probit")
display(m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment