Skip to content

Instantly share code, notes, and snippets.

@andybega
Last active August 7, 2019 17:09
Show Gist options
  • Save andybega/0e0dcc821dfd183a9bb9429afbbb07a6 to your computer and use it in GitHub Desktop.
Save andybega/0e0dcc821dfd183a9bb9429afbbb07a6 to your computer and use it in GitHub Desktop.
Fraction of neighboring US states with a policy
library("splm")
data("usaww")
?usaww
# Only Alabama has this policy
policy_x <- c(1, rep(0, 47))
names(policy_x) <- rownames(usaww)
head(policy_x)
# Fraction of neighboring states with policy x
usaww %*% policy_x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment