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
mlogit alternativesDear Statalists, I have 4 alternatives ( let's say A B C and D ). I thought earlier a multinomial l…
Related to control variables choice in cross-sectional Difference in Differences regressionDear all, I am investigating the effect of the X policy passed in 2005 on women's employment outcome…
Need help on clarification why chi-square test shows significant relationship but Survival analysis shows no significant influence.I'm trying to understand the impact of waiting time at intersection on pedestrian signal violation b…
Sample weights to twoway line graphDear all, I am trying to plot net transfers by groups in € (y-axis) against age (x-axis) in one gra…
Order coefficients in bycoefs coefplotHello, I have created this coefplot with the "bycoefs" option. I am happy with it, but I would like…
Subscribe to:
Post Comments (Atom)
0 Response to Combined new variable: code MV from other variables
Post a Comment