Download 23/replication_package/Code/replicate_table_A5.R from chuxuan/REPRO-Bench: direct link, hf CLI and curl.
- Browser
- Download file 2.83 kB
-
https://huggingface.co/datasets/chuxuan/REPRO-Bench/resolve/main/23/replication_package/Code/replicate_table_A5.R
- Command line
-
hf download hf://datasets/chuxuan/REPRO-Bench/23/replication_package/Code/replicate_table_A5.R
-
curl -L -o replicate_table_A5.R https://huggingface.co/datasets/chuxuan/REPRO-Bench/resolve/main/23/replication_package/Code/replicate_table_A5.R
2.83 kB
| ##--##--##--##--##--##--## | |
| ## Appendix: Table A5 | |
| ##--##--##--##--##--##--## | |
| # Status (excluded, not excluded) | |
| nv_status = lm(success ~ EPR_STATUS_EXCL + EPR_GROUPSIZE + POP_LOG_LAG_EXT + GDPPC_LOG_LAG_EXT + PASTNV + PASTV + VDEM_POLYARCHY_LAG + VDEM_PHYSINT_LAG + EPR_TEK_EGIP + EPR_DOWNGRADED5 + HORIZ_INEQ + NVYEARS + I(NVYEARS^2) + I(NVYEARS^3) + VYEARS + I(VYEARS^2) + I(VYEARS^3) , data= EBCR_EPR_NAVCO2[EBCR_EPR_NAVCO2$INIT_NV_ONSET==1,]) | |
| v_status = lm(success ~ EPR_STATUS_EXCL + EPR_GROUPSIZE + POP_LOG_LAG_EXT + GDPPC_LOG_LAG_EXT + PASTNV + PASTV + VDEM_POLYARCHY_LAG + VDEM_PHYSINT_LAG + EPR_TEK_EGIP + EPR_DOWNGRADED5 + HORIZ_INEQ + NVYEARS + I(NVYEARS^2) + I(NVYEARS^3) + VYEARS + I(VYEARS^2) + I(VYEARS^3) , data= EBCR_EPR_NAVCO2[EBCR_EPR_NAVCO2$INIT_V_ONSET==1,]) | |
| preds_nv = ggpredict(nv_status, terms = c("EPR_STATUS_EXCL")) | |
| preds_nv$tactic = "Non-violent" | |
| preds_v = ggpredict(v_status, terms = c("EPR_STATUS_EXCL")) | |
| preds_v$tactic = "Violent" | |
| preds_status = rbind(preds_nv, preds_v) | |
| preds_status$tactic <- factor(preds_status$tactic, levels = c("Violent", "Non-violent")) | |
| preds_status$Status = "Excluded" | |
| preds_status$Status[preds$x==0] = "Not excluded" | |
| preds_status$type = "status" | |
| ## Size (above and below the mean of the distribution) | |
| EBCR_EPR_NAVCO2$small_size = NA | |
| EBCR_EPR_NAVCO2$small_size[EBCR_EPR_NAVCO2$EPR_GROUPSIZE < mean(EBCR_EPR_NAVCO2$EPR_GROUPSIZE, na.rm=T)] = 1 | |
| EBCR_EPR_NAVCO2$small_size[EBCR_EPR_NAVCO2$EPR_GROUPSIZE >= mean(EBCR_EPR_NAVCO2$EPR_GROUPSIZE, na.rm=T)] = 0 | |
| nv_size = lm(success ~ small_size + POP_LOG_LAG_EXT + GDPPC_LOG_LAG_EXT + PASTNV + PASTV + VDEM_POLYARCHY_LAG + VDEM_PHYSINT_LAG + EPR_TEK_EGIP + EPR_DOWNGRADED5 + HORIZ_INEQ + NVYEARS + I(NVYEARS^2) + I(NVYEARS^3) + VYEARS + I(VYEARS^2) + I(VYEARS^3) , data= EBCR_EPR_NAVCO2[EBCR_EPR_NAVCO2$INIT_NV_ONSET==1,]) | |
| v_size = lm(success ~ small_size + POP_LOG_LAG_EXT + GDPPC_LOG_LAG_EXT + PASTNV + PASTV + VDEM_POLYARCHY_LAG + VDEM_PHYSINT_LAG + EPR_TEK_EGIP + EPR_DOWNGRADED5 + HORIZ_INEQ + NVYEARS + I(NVYEARS^2) + I(NVYEARS^3) + VYEARS + I(VYEARS^2) + I(VYEARS^3) , data= EBCR_EPR_NAVCO2[EBCR_EPR_NAVCO2$INIT_V_ONSET==1,]) | |
| preds_nv = ggpredict(nv_size, terms = c("small_size")) | |
| preds_nv$tactic = "Non-violent" | |
| preds_v = ggpredict(v_size, terms = c("small_size")) | |
| preds_v$tactic = "Violent" | |
| preds_size = rbind(preds_nv, preds_v) | |
| preds_size$tactic <- factor(preds_size$tactic, levels = c("Violent", "Non-violent")) | |
| preds_size$Status = "Group size < mean" | |
| preds_size$Status[preds_size$x==0] = "Group size >= mean" | |
| preds_size$type = "size" | |
| preds_all = as.data.frame(rbind(preds_status, preds_size)) | |
| preds_all = preds_all[,c("predicted", "std.error", "conf.low", "conf.high", | |
| "tactic", "Status")] | |
| table_a5 = xtable(preds_all, digits=2) | |
| print(table_a5, file="Tables/table_A5.tex") | |