Data sample (I leave out other variables for illustrations purpose)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long Acq_Boardex_ID str12 Acq_Isin byte _merge 26113 "AU000000RMD6" 1 26113 "AU000000RMD6" 1 26113 "AU000000RMD6" 1 26113 "AU000000RMD6" 1 26113 "AU000000RMD6" 1 26113 "US7611521078" 3 26113 "US7611521078" 3 26113 "US7611521078" 3 26113 "US7611521078" 3 26113 "US7611521078" 3 end label values _merge _merge label def _merge 1 "Master only (1)", modify label def _merge 3 "Matched (3)", modify
By Acq_Boardex_ID, I would like to replace the Acq_Isin in cases where _merge = 1 with the Acq_Isin from the company where _merge = 3.
This is probably a super easy task but due to my rusty Stata knowledge, I haven't really got any further with a solution and appreciate any help.
Best
0 Response to Replace variable with subset of observations
Post a Comment