I am using a data set of 50 countries which are separated into four regions.
I want to create a variable of regional contagion, where recgontagion for country j takes one if and only if there is a crisis in at least one country other than country j and this country is in the same region as country j.
I have been the below command but it doesn't work:
replace regcontagion=1 if (evnt3w==1&country!=country ®ion_id==region_id)
Related Posts with Creating a variable with three condtions
3 plots gathered in 1 subplotHi, I am struggling to gather 3 plots in 1 unique figure with 3 subplots. I want the subplots to de…
Problem with summing using CollapseHi - I'm having a problem with the Collapse command when I try to obtain the sum of variables. My da…
Insert comma in string variableHi, I have a numeric variable that I would like to convert into a string variable with commas separ…
Difference-in-means tests for the propensity-matched sampleIs there an efficient way in Stata to report the results of difference in means tests on propensity …
xtpcse and xtgls with fixed effectsHello community: I want to robustly estimate (xtgls) a panel data model, for both FE and RE. The fol…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable with three condtions
Post a Comment