-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
507 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#' @importFrom tibble tibble | ||
NULL | ||
|
||
#' Modeling Coups in Africa, 1960 to 1975 (1982) | ||
#' | ||
#' A data set on modeling coups in Africa using data from the period between | ||
#' 1960 to 1975 (1982). These data offer a partial replication of Jackman | ||
#' (1978). | ||
#' | ||
#' @format A data frame with the following 10 variables. | ||
#' \describe{ | ||
#' \item{\code{iso3c}}{a three-character ISO code for state identification} | ||
#' \item{\code{country}}{an English country name} | ||
#' \item{\code{jci}}{Jackman's (1978) coup index from 1960 to 1975} | ||
#' \item{\code{tmis}}{Johnson et al.'s (1986) total military involvement score} | ||
#' \item{\code{agperc}}{an estimate of the percentage of the country's labor force in agriculture} | ||
#' \item{\code{literacy_cnts}}{an estimate of countrywide literacy from around 1965} | ||
#' \item{\code{literacy_ba}}{another estimate of countrywide literacy from around 1965} | ||
#' \item{\code{leperc}}{an estimate of the size of the largest ethnic group, as a percentage} | ||
#' \item{\code{partydom}}{the percentage of the vote received by the largest party in the country prior to independence} | ||
#' \item{\code{turnout}}{the turnout (as a percentage) at the independence referendum} | ||
#' } | ||
#' | ||
#' @details | ||
#' | ||
#' Data exist for instructional purposes, especially about modeling interactions. | ||
#' Reading Jackman (1978) and Johnson et al. (1986) will provide more information | ||
#' about the stake of this debate. | ||
#' | ||
#' English country names are country names from around the time of publication. | ||
#' Take note of older names of "Dahomey", "Swaziland", "Upper Volta", and "Zaire." | ||
#' The three-character ISO codes are current, though it comes with the | ||
#' acknowledgment that Dahomey used to have a different ISO code. | ||
#' | ||
#' Jackman (1978) is deceptively opaque on what he's doing for the ethnic group | ||
#' variable and arguably misleads on what his turnout variable is actually from. | ||
#' In the case of the ethnic group variable, it's the difference between saying | ||
#' the largest ethnic group in Rwanda is 98% of the population versus 80% of | ||
#' the population. I'm uncertain with what he's doing with what Morrison et al. | ||
#' (1989) define as "ethnic clusters". | ||
#' | ||
#' Mercifully, the coup variables come from a replication by Johnson et al. (1986). | ||
#' The bulk of this is arguably lost to history. | ||
#' | ||
#' Ideally, I'd have Morrison's (1972) \emph{Black Africa}, but I do not. I have | ||
#' a copy of a 1989 update, though. That's what I consulted in constructing | ||
#' this data set. | ||
#' | ||
#' Related: the agricultural variable is a midway point between columns B and | ||
#' columns C in Table 3.11 of Morrison et al. (1989). I do not think this is too | ||
#' far removed from what Jackman was looking at in an older version of the same | ||
#' data, but there will be slight differences. It's the difference of "these | ||
#' variables came from 1966" versus "this is an imputation of 1960 to 1970". The | ||
#' latter is what I offer here. | ||
#' | ||
#' The literacy variables have suffices communicating where I obtained them. The | ||
#' Cross-National Time Series Database has a variable effectively communicating | ||
#' this information that I was using first. These data come 1965 in that data set. | ||
#' Jackman and Johnson et al. are assuredly using Morrison's almanac. That | ||
#' information is in Table 4.11 or Morrison et al. (1989). | ||
#' | ||
#' Ethiopia is conspicuously missing in the party dominance variable. | ||
#' | ||
#' I am 99.9% sure the turnout variable is Table 5.9 in Morrison et al. (1989). | ||
#' Jackman (1978) says this is from *before* independence but I'm confident he | ||
#' meant it was the turnout at the independence referendum. | ||
#' | ||
#' @references | ||
#' | ||
#' Jackman, Robert W. 1978. "The Predictability of Coups d'etat: A Model with | ||
#' African Data." \emph{American Political Science Review} 72(4): 1262-75. | ||
#' | ||
#' Johnson, Thomas H., Robert O. Slater, and Pat McGowan. 1986. "Explaining | ||
#' African Military Coups d'Etat, 1960-1982." \emph{American Political Science | ||
#' Review} 80(4): 225-49. | ||
#' | ||
#' Morrison, Donald George, Robert Cameron Mitchell, and John Naber Paden. 1989. | ||
#' \emph{Black Africa: A Comparative Handbook} (2nd ed.). New York, NY: The Free | ||
#' Press. | ||
|
||
"african_coups" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
CNTS <- readxl::read_excel("/home/steve/Dropbox/data/cnts/CNTSDATA.xls") | ||
library(tidyverse) | ||
|
||
# CNTS %>% | ||
# mutate(iso3c = countrycode::countrycode(country, "country.name", "iso3c")) %>% | ||
# #select(country, iso3c, year, polit01:polit15) %>% | ||
# mutate(iso3c = case_when( | ||
# country == "CEN AFR REP" ~ "CAF", | ||
# country == "CEN AFR EMP" ~ "CAF", | ||
# country == "ETH'PIA FDR" ~ "ETH", | ||
# country == "ETH'PIA PDR" ~ "ETH", | ||
# TRUE ~ iso3c | ||
# )) %>% | ||
# mutate(iso2c = countrycode::countrycode(iso3c, "iso3c", "iso2c")) %>% | ||
# filter(year %in% c(1964:1966)) %>% | ||
# select(country, year, iso2c, iso3c, industry3, school12) %>% | ||
# # Take ag from 1966 if you can. Take school from 1965 if you can. | ||
# filter(iso3c %in% c("MDG", "GNQ", "GNB", | ||
# "COM", "SYC", "ZWE", | ||
# "ANG", "MOZ", "STP", "BWA", | ||
# "CPV", "DJI", "LSO", "MUS", | ||
# "SWZ")) | ||
|
||
|
||
|
||
readxl::read_excel("/home/steve/Dropbox/projects/stevedata/data-raw/african_coups/african_coups.xlsx") %>% | ||
arrange(iso3c) %>% | ||
select(iso3c, everything(), -agperc_cnts) %>% | ||
rename(agperc = agperc_ba) -> african_coups | ||
|
||
|
||
save(african_coups, file="data/african_coups.rda") | ||
|
||
# | ||
# mutate(ddd = 100 - agperc_ba) %>% | ||
# mutate(m = ddd+literacy_ba, | ||
# p = ifelse(turnout >= 20, 1, 0), | ||
# c = ifelse(leperc >= 44, 1, 0)) -> A | ||
# | ||
# | ||
# broom::tidy(M1 <- lm(jci ~ m*partydom*leperc, A)) | ||
# broom::tidy(M2 <- lm(jci ~ m + c + partydom + p + partydom*p + c*partydom + c*p, A)) | ||
# broom::tidy(M3 <- lm(jci ~ m + c + partydom + p, A)) | ||
|
||
|
||
|
||
sbroom::augment(M1) %>% | ||
ggplot(.,aes(.fitted, jci)) + geom_point() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.