hello
i'm trying to merge two datasets but I'm not sure if what I'm trying to do (which is not working out) is even correct or possible.
I have a dataset measuring sexual violence in conflict and one which measures female combatants in conflict. I now want to add the variable that measures female combatants in conflict to the dataset of sexual violence.
i tried merging them by the common variables country, and conflict duration but stata tells me that " variables conflictdur country do not uniquely identify observations in the master data
r(459)"
this is what i did so far:
use wood_thomasJPR_replication12.dta, clear
rename duration conflictdur
sort conflictdur country
save wood_thomasJPR_replication12.dta, replace
clear
***********
use Repl2_Cohen_Nordas_JCR.dta
sort conflictdur country
save Repl2_Cohen_Nordas_JCR.dta, replace
clear
***********
use Repl2_Cohen_Nordas_JCR.dta, clear
merge 1:1 conflictdur country using wood_thomasJPR_replication12.dta, keepusing(female_combat_binary) keep(match master)
drop _merge
I'm actually just interested in adding the variable "female_combat_binary" to the "Repl2_Cohen_Nordas_JCR.dta" dataset.
Thanks for your help!!
Related Posts with Merging datasets
Help with outputting Mixed command results to ExcelHello, I hope you could help me, I have spent days trying to figure this out. I am trying to output…
Premature DeindustrializationHello everyone, I'm testing premature deindustrialization as Rodrik (2015) I regress manufacture em…
Merging two files on multiple criteria and imperfect matching?Hi, I have two data files I want to merge. The issue is I don't have an ID column shared by both fil…
loop over the panel IDs to use quantile regressions xtqregHi, I am running quantile regression for panel of 260 firms for period of 15 years. The general reg…
OLS model that includes related covariates that add up to 100%Hi group, I'm running an OLS model where the dependent variable is patients' average value of HgA1c,…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets
Post a Comment