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
Reference category in mi estimate logisticDear all, I would like to do a logistic regression with multiple imputed data. My syntax is: mi es…
Defining value labels based on varlistDear all, I am writing a program which at the beginning I define a varlist: syntax varlist (min=3 n…
Poisson and Negative Binomial Distribution and Stata CodesDear Stata Forum, My question relates more with the theory of Poisson and Negative Binomial Poisson…
Weak instrument test for ivprobit with clustering?Hello, I am seeking advice about how to run a weak instrument test after estimating an ivprobit mode…
Help with long dataHi, I have previously posted here and received great help. Need help with one last area that I am r…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets
Post a Comment