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
Fixed effects (in Accelerated Failure Time Survival Model)Hi, For my research I am examining private equity strategies and their subsequent exit-types. My da…
After regression, how can I do calculation using r2 and N?After regression, I want to calculate the scalar, that is r2*N How should I do that? I know my bad …
how can I turn year of birth into age?Hello! I'm trying to recode a variable named V241 in the World Values Survey data set (which can be …
STataSta …
When Stata if command is false, calling on Mata causes errorsHi everyone, Using Stata 15.1 MP8, I've encountered a variety of errors that seem to be caused by ca…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets
Post a Comment