Dear Statalist,
I would like to use a conditional logit model to analyze the following survey questionnaire: Q75: In what ways did the partial government shutdown negatively affect your work? (Check all that apply). There are 10 response options for this item; 75_1: Unmanageable workload, 75_2: Missed deadlines, ..., 75_10: Other.
My current data structure is as...
id shut_1 shut_2 shut_3 shut_4 shut_5 shut_6 shut_7 shut_8 shut_9 shut_10 sex age ...
1 1 1 0 0 0 0 0 1 0 0
2 0 0 0 0 0 0 0 1 1 0
I want to change this to:
id shut_1 shut_2 shut_3 shut_4 shut_5 shut_6 shut_7 shut_8 shut_9 shut_10 sex age ...
1 1 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 0 0
2 0 0 0 0 0 0 0 1 0 0
2 0 0 0 0 0 0 0 0 1 0
I've noticed that the reshape command is not quite what I am looking for, since it merges the binary categorical variables (shut_1, ... shut_10) into one single variable.
Could anyone show me how to solve this?
Thanks.
Related Posts with Reshaping data for conditional logit modeling
keep Data between certain datesHi, I want to drop all data that is outside of my range. I tried following code Code: drop if mont…
Computing Z-Score (risk measure)Hi guys, I´m new here and have just startet do use STATA for my thesis. So basically I´m interested…
Sample size calculation for multiple arm designHello everyone, I hope you are all doing well. I have a friend that is designing a study evaluating …
Drop if 3 consecutive quarters of negative sales growthHey! I have some difficulties to write a proper code to clean my data. The goal is to keep only fir…
How to find the amount of gaps in a natural number sequence?Dear Stata community, I have some oddly formatted data, as in the following example dataset: Code:…
Subscribe to:
Post Comments (Atom)
0 Response to Reshaping data for conditional logit modeling
Post a Comment