Hello,
I am trying to establish a multinomial logit model in stata.
I have a panel of 60 countries, whith 24 observations per country.
I have a variable CC that takes the values 0 and 1, and I want to create a variable S such:
S returns 1 if CC[_n+1]==1
S returns 2 as long as CC remains ==1 after CC[_n+1]==1 // per country (so per the 24 observations)
S returns 0 otherwise.
I know the basic generate S, and replace S but I am not sure how to write the code for "S to return 2"
Thank youu
Corine El Habr
Related Posts with creating an mutinomial variable
Can the attenuation bias of a demeaned dependent variable be solved by an control function approach?I recently demeaned my dependent variable by a group interaction. Mainly because simply adding them …
2SLS For BeginnersI am would love some help understanding how to run a 2SLS. I am replicating a table and first ran an…
Negative scale value using fixed effects quantile regression xtqregI have individual-level panel wealth-at-age data with 4600 observations on 350 individuals. Because …
Export matrix to Word with asdocx after the predict commandProf River Huang asked the following question Dear Attaullah, Is it possible to put the results …
Manipulating local listsIn my code below I expected to get a local macro (myvars2) with a list of all my variables (which ar…
Subscribe to:
Post Comments (Atom)
0 Response to creating an mutinomial variable
Post a Comment