Learn R Programming

SemiParBIVProbit (version 3.7-1)

war: Civil war data

Description

Civil war data from Fearon and Laitin (2003).

Usage

data(war)

Arguments

Format

war is a 6326 row data frame with the following columns
onset
equal to 1 for all country-years in which a civil war started.
instab
equal to 1 if unstable government.
oil
equal to 1 for oil exporter country.
warl
equal to 1 if the country had a distinct civil war ongoing in the previous year.
gdpenl
GDP per capita (measured as thousands of 1985 U.S. dollars) lagged one year.
ncontig
equal to 1 for non-contiguous state.
nwstate
equal to 1 for new state.
lpopl
log(population size).
lmtnest
log(mountainous).
ethfrac
measure of ethnic fractionalization (calculated as the probability that two randomly drawn individuals from a country are not from the same ethnicity).
relfrac
measure of religious fractionalization.
polity2l
measure of political democracy (ranges from -10 to 10) lagged one year.

Source

Data are from: Fearon J.D., Laitin D.D. (2003), Ethnicity, Insurgency, and Civil War. The American Political Science Review, 97, 75-90.

Examples

Run this code

## Not run:  
# 
# #########################################################
# #########################################################
# 
# library("SemiParBIVProbit")
# 
# data("war", package = "SemiParBIVProbit")        
# 
# ###################################################
# # 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 <- SemiParBIVProbit(list(reb.eq, gov.eq), data = war, Model = "BPO")
# 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 <- SemiParBIVProbit(list(reb.eq, gov.eq), data = war, Model = "BPO0")
# 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)

#

Run the code above in your browser using DataLab