I have a dataset with 727 observation and 29 variables. The variables with biom and solar prefix are alternative which is 1 when chosen and zero when not chosen.educ is a categorical variable for education while ch is a choice variable which I also want to generate as a dependent variable for nested logit in stata.
id biom_trad biom_mod solar_trad solar_mod educ ch
1. 1 0. 0. 0. 1. 1
2. 0. 1. 0. 0. 3. 2
3. 0. 0. 0. 1. 2. 4
I want to convert this to a nested logit long format where I would have each individual having 4 rows showing the alternative chosen rowwise and to also construct the chosen variable that looks like the ch variable above for the particular individual.. Just like the needed nested log it format required in stata.
Thanks
Related Posts with Having problem reshaping my qualitative data for estimation of nested logit
Keep the first observation within a moving 30-day windowI have the following dataset. I want to keep d=1 for the first observation within 30-day moving wind…
Detecting inverted duplicates over two columnsHello, I have searched for an answer to this simple question on previous forums, and cannot find the…
Is it possible to not set values of optional integer arguments with the syntax commandWhen specifying optional arguments integer arguments using the syntax command it is usually necessar…
Nested forvalue loops - referring to previous macros in a relevant macroGood afternoon. Could anyone help me decipher what syntax error I am producing in the below command…
Why the different bootstrap errors in panel data random effects?Hi, in help xt_vce_options I found the following recommendation: When working with panel-data mode…
Subscribe to:
Post Comments (Atom)
0 Response to Having problem reshaping my qualitative data for estimation of nested logit
Post a Comment