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