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
Doubt on Heckprob model resultsHello everybody, I'm running a Heckman selection model based on a heckprob. I have some categorical…
Exporting residuals vs prediction dataHi, So, I need to make a residuals versus predictor plot. However, the graphics aren't working in S…
Help creating graph for multiple linear regressionDear all, I am using Stata 16, on mac. I am estimating the regression: reg GDP agedpop population …
how to delete specific observationsHello everyone I need to delete the firms that does not have data for three years consecutively. ple…
Medeff command: invalid mediate (error r(198))Dear Statalists, Could you please tell me the reason why when I type the following command: medeff…
Subscribe to:
Post Comments (Atom)
0 Response to creating an mutinomial variable
Post a Comment