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
Many interaction terms omitted in panel regressionHello everyone, I am trying to include interaction terms (between a dummy variable and time-dummy v…
Using poi2hdfe to account for both country-year and regional fixed effectsHi everyone, R user switching to STATA for replicaiton purposes here. Apologies in advance if my que…
How to interpret this post command?Commands: mixed eu_image || nordsyd_eu:, baselevel (first variable is positive/negative opinion to …
Taking the sum of some observationsHi all, I have a question. I have a dataset like the left table in my screenshot (small example). I…
Creating predictor in fake data with some known parametersDear all, I am trying to create some fake data, where x = z * 0.466 + e_x, and x follows a normal d…
Subscribe to:
Post Comments (Atom)
0 Response to Reshaping data for conditional logit modeling
Post a Comment