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
how to gen variable with two valuehow to Dividend dummy is a variable set to one if the firm paid a dividend in the year, and set to 0…
Stuck while calculating moving medianHello, Currently, I am writing my thesis, in which I have to calculate the moving median of the ROE…
panel data: aggregate imputed variables to a new variable using miI am working with panel data for two waves at the moment. The dependent variable (outcome) is a bina…
No data is running with adding "capture" to my code, but there is no new error message (this code works for my elder collegue)Dear, Sorry in advance if I'm maybe not using the right STATA-language! I'm using STATA 16.1 on Wi…
Multiple Instrumental VariableHey everyone, I have the following equation: y=aX1+bX2+cX3+dX4+e I want to instrument Z1 for X1 a…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets
Post a Comment