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
Fix value of a variable in Panel DataHey! Unfortunately I could not find any answers to my question in previous posts. I am working wit…
Need helpclear all set more off mat drop _all pause off set graphics on // Control Pannel local beta "no" l…
Comparing one binary variable to anotherI have data from a survey on two questions (Yes or no answers). I want to test the hypothesis that "…
Transformation and standardisation of variablesDear friends, I have some knowledge on standardisation, but I still have doubts; I would like to und…
Problem with variables in the correlation matrixHello there, i am trying to create a correlation matrix with several variables. One of my variables…
Subscribe to:
Post Comments (Atom)
0 Response to creating an mutinomial variable
Post a Comment