Description Usage Format Source Examples
Civil war data from Fearon and Laitin (2003).
1 |
war
is a 6326 row data frame with the following columns
equal to 1 for all country-years in which a civil war started.
equal to 1 if unstable government.
equal to 1 for oil exporter country.
equal to 1 if the country had a distinct civil war ongoing in the previous year.
GDP per capita (measured as thousands of 1985 U.S. dollars) lagged one year.
equal to 1 for non-contiguous state.
equal to 1 for new state.
log(population size).
log(mountainous).
measure of ethnic fractionalization (calculated as the probability that two randomly drawn individuals from a country are not from the same ethnicity).
measure of religious fractionalization.
measure of political democracy (ranges from -10 to 10) lagged one year.
Data are from:
Fearon J.D., Laitin D.D. (2003), Ethnicity, Insurgency, and Civil War. The American Political Science Review, 97, 75-90.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | ## Not run:
#########################################################
#########################################################
library("GJRM")
data("war", package = "GJRM")
###################################################
# Bivariate brobit model with partial observability
###################################################
reb.eq <- onset ~ instab + oil + warl + lpopl + lmtnest + ethfrac +
polity2l + s(gdpenl) + s(relfrac)
gov.eq <- onset ~ instab + oil + warl + ncontig + nwstate + s(gdpenl)
bpo <- gjrm(list(reb.eq, gov.eq), data = war, Model = "BPO",
margins = c("probit", "probit"))
conv.check(bpo)
# perhaps model is to complex
set.seed(1)
sbpo <- summary(bpo)
sbpo$theta; sbpo$CItheta
# let's exclude the correlation parameter in fitting
bpo0 <- gjrm(list(reb.eq, gov.eq), data = war, Model = "BPO0",
margins = c("probit", "probit"))
conv.check(bpo0)
summary(bpo0)
war.eq <- onset ~ instab + oil + warl + ncontig + nwstate + lpopl +
lmtnest + ethfrac + polity2l + s(gdpenl) + s(relfrac)
Probit <- gam(war.eq, family = binomial(link = "probit"), data = war)
summary(Probit)
coef(Probit)[(which(names(coef(Probit)) == "s(gdpenl).9"))]
coef(bpo0)[(which(names(coef(bpo)) == "s(gdpenl).9"))]
probitW <- bpoW <- bpoReb <- bpoGov <- NA
gdp.grid <- seq(0, 8)
median.values <- data.frame(t(apply(war, 2, FUN = median)))
for (i in 1:length(gdp.grid)){
newd <- median.values; newd$gdpenl <- gdp.grid[i]
eta1 <- predict(bpo0, eq = 1, newd)
eta2 <- predict(bpo0, eq = 2, newd)
probitW[i] <- predict(Probit, newd, type = "response")
bpoW[i] <- pnorm(eta1)*pnorm(eta2)
bpoReb[i] <- pnorm(eta1)
bpoGov[i] <- pnorm(eta2)
}
plot(gdp.grid, probitW, type = "l", ylim = c(0, 0.55), lwd = 2,
col = "grey", xlab = "GDP per Capita (in thousands)",
ylab = "Pr(Outcome)", main = "Probabilities for All Outcomes",
cex.main = 1.5, cex.lab = 1.3, cex.axis = 1.3)
lines(gdp.grid, bpoW, lwd = 2)
lines(gdp.grid, bpoReb, lwd = 2, lty = 2)
lines(gdp.grid, bpoGov, lwd = 2, lty = 3)
#dev.copy(postscript, "probWAR.eps", width = 8)
#dev.off()
## End(Not run)
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.