{"id":24111887,"url":"https://github.com/andybega/ijf-ilc2014","last_synced_at":"2026-06-08T01:31:12.213Z","repository":{"id":26619690,"uuid":"30075096","full_name":"andybega/ijf-ilc2014","owner":"andybega","description":"Replication for: Irregular Leadership Changes in 2014: Forecasts using ensemble, split-population duration models, International Journal of Forecasting","archived":false,"fork":false,"pushed_at":"2019-04-11T12:45:42.000Z","size":5258,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T13:22:41.742Z","etag":null,"topics":["coups","dataverse","ensemble","forecasting","leadership-changes","political-science","r","replication"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andybega.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-30T14:23:35.000Z","updated_at":"2019-04-11T12:45:44.000Z","dependencies_parsed_at":"2022-09-01T13:52:06.408Z","dependency_job_id":null,"html_url":"https://github.com/andybega/ijf-ilc2014","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andybega/ijf-ilc2014","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fijf-ilc2014","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fijf-ilc2014/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fijf-ilc2014/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fijf-ilc2014/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andybega","download_url":"https://codeload.github.com/andybega/ijf-ilc2014/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fijf-ilc2014/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34044919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coups","dataverse","ensemble","forecasting","leadership-changes","political-science","r","replication"],"created_at":"2025-01-11T02:52:17.117Z","updated_at":"2026-06-08T01:31:12.198Z","avatar_url":"https://github.com/andybega.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"Replication materials for IJF ILC 2014 paper\"\noutput: github_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```\n\n**[Irregular Leadership Changes in 2014: Forecasts using ensemble, split-population duration models](http://www.sciencedirect.com/science/article/pii/S0169207015000485)**\n\nFor questions contact the corresponding author [Michael Ward](mailto:michael.don.ward@gmail.com) or [Andreas Beger](mailto:adbeger@gmail.com).\n\nThis article is a summary of a longer technical report for the [PITF](http://en.wikipedia.org/wiki/Political_Instability_Task_Force). The complete [original report](http://arxiv.org/abs/1409.7105) is available on arXiv.org, and contains a large amount of additional information on the method we used for forecasting, accuracy assessments, etc.\n\n\n**Citation:**\n\n```bibtex\n@article{beger2016irregular,\n  title={Irregular Leadership Changes in 2014: Forecasts using ensemble, split-population duration models},\n  author={Beger, Andreas and Dorff, Cassy L. and Ward, Michael D.},\n  journal={International Journal of Forecasting},\n  year={2016},\n  volume={32},\n  issue={1},\n  pages={98--111}\n  }    \n```\n\nGetting the code and data\n-----\n\nThe easiest way to get the replication code is to [download a zip](https://github.com/andybega/ijf-ilc2014/archive/master.zip). Alternatively, you can clone the repository through the Github GUI client ([OS X](https://mac.github.com/), [Windows](https://windows.github.com/)).\n\nThe data are available on dataverse: [http://dx.doi.org/10.7910/DVN/28942](http://dx.doi.org/10.7910/DVN/28942). Several smaller intermediate results are included in the git data folder, but replicating the full analysis will require the larger raw data from dataverse. \n\n\nRunning the replication\n-----\n\n1. [Download](https://github.com/andybega/ijf-ilc2014/archive/master.zip) or [clone](github-mac://openRepo/https://github.com/andybega/ijf-ilc2014) this repository. \n\n2. Download the data sets on [Dataverse](http://dx.doi.org/10.7910/DVN/28942), at least the 2 beginning with `irc-data` and place them in `replication/data`.\n\n3. In `runme.R`, change the working directory path on line 33.\n\n4. Source or run the code in `runme.R`. We recommend running through the code block by block rather than sourcing. The original analysis was run on OS X using R 3.0.2 and 3.1.1.\n\nThe script relies on two packages, `EBMAforecastbeta` and `spduration` that are not available on CRAN. They are included in `replication/R/packages` with both OS X and Windows versions. The replication script will attempt to install them if they are not already present, but you may have to do so manually if this fails.\n\nFiles and scripts\n------\n\n`data`:\n\n* `all_preds.rda` - contains all theme/ensemble predictions from 2001 to 2014-09; used throughout `runme.r` to replicate figures in the same order as in the article, even though the models needed to create it are estimated in the same script   \n* `ensemble_data.rda` - calibration/test data to estimate ensemble\n* `irc_data_mod.rda` - imputed data\n* `ensemble.rda` - saved ensemble model object\n* `irc-data-v3.rda` - raw, unimputed source data\n* `model_estimates.rda` - saved estimates for the 7 theme models\n\n`graphics`:\n\n* Contains the graphics used in the article.\n\n`R/packages`:\n\n* `EBMAforecastbeta_0.44.tar.gz` – OS X source package\n* `EBMAforecastbeta_0.44.zip` – Windows source package\n* `spduration_0.12.tar.gz` – OS X source package\n* `spduration_0.12.zip` – Windows source package\n\n`R/utilities`:\n\n* `ensemble_forecast.r` - helper functions to calculate ensemble forecast\n* `gather_preds.r` - gathers all theme/ensemble predictions from 2001 to 2014-09 in one data frame, `all_preds.rda`\n* `theme_models.r` - helper functions for theme model fit\n* `varDecomp.r` - helpfer functions for variable variance decomposition\n* `worldMap.r` - function for choropleth worldmap\n\n\n## 2019-04-05 Update\n\nChecked replication and updated several issues. See `runme.R` for more details in the notes at the top. \n\nTo replicate the exact results, use the saved fitted models and predictions. \n\n```{r}\nsessionInfo()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybega%2Fijf-ilc2014","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandybega%2Fijf-ilc2014","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybega%2Fijf-ilc2014/lists"}