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
coefplot : groups() option not producing desired resultsHi Stata users, I am using coefplot in Stata 15 to try and replicate the graph below where there are…
Multiple imputations: Predicting missing for selected categoriesHi I'm currently trying to use multiple imputation for a register based cohort analysis on maternal…
njc_stuff package updated on SSCThanks as ever to Kit Baum, this package has been updated on SSC. The following explanation is iden…
problem with gsemHi all, I am quite new to Stata and I am trying to run a Bernoulli-logit regression with gsem builde…
Dropping variables based on date availabilityHello, I am struggling with cleaning my data. Array I have panel data regarding banks. I would li…
Subscribe to:
Post Comments (Atom)
0 Response to creating an mutinomial variable
Post a Comment