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
Multiple treatmentsHi I have a panel of roughly 1000 firms across 10 years (2004-2013) in 2 states in the US (CA and PA…
Any alternative to svy: bsqreg ? [Since svy does not support bsqreg]I was wondering if there are any alternatives to using svyset since bsqreg does not support svy and …
String variable to date formatHi, I am encountered with a problem in converting a string variable to date format to enable time s…
Loop Through The Same Procedures with Multiple DatasetsHi all, I have several datasets that I would like to do the same procedures to. I have the same gen…
How to import large mdb fileHi, I have to import large .mdb files and transfer into stata file. As the databases are saved in 3…
Subscribe to:
Post Comments (Atom)
0 Response to creating an mutinomial variable
Post a Comment