I would like to create a variable in which I code 1 if a certain threshold in several other indicators is met. 0 only if the threshold is not met in any of the variables. In my case, I'm trying to assess the "objective" interest of a country in migration if the share of immigrants OR the share of emigrants OR the share of remittances/GDP is beyond my thresholds.
I did the following:
. gen miginterest1=1 if immi_share>=0.15
. replace miginterest1=1 if emi_share>=0.15
. replace miginterest1=1 if remit_share>=15
*Since I needed the rows that didn't meet my threshold to be coded as 0 I did:
. mvencode miginterest1, mv(0)
* the problem is that this also codes countries where there is missing information as 0, which it should't. I tried to recode, if and replace if but it didn't work. It's probably a straightforward syntax issue but any help would be appreciated! Thanks!
Related Posts with Combined new variable: code MV from other variables
How to compute the OR for 30 or 10 unit increase of a continuous predictorHello everyone, I would like to ask a question about computing the OR in logistic regression analysi…
How to conduct sensitivity test for DiD following Borusyak?I am using DiD imputation of Borusyak,2021, I am wondering how to do sensitivity test by using did_i…
Restricting sample to same observations in each yearHello, I have a panel with individuals who are followed over a 5 year period. I have 7100 individual…
"Attempt to protect stack guard pages failed" when initializing Stata within PythonStata MP 17.0 (current update level: 09 Aug 2021), pystata version 0.1.0 Platform: OS X 11.5.2 runni…
Seems the Growth Incidence Curves command in Stata 13 has vanished?Dear All, I'm still using Stata 13 and can't find the Code: gicurve command. I will appreciate any …
Subscribe to:
Post Comments (Atom)
0 Response to Combined new variable: code MV from other variables
Post a Comment