----------------------- copy starting from the next line -----------------------
Hi Stata people ,
I am reshaping wide variables to long. However, after running the command reshape long primaryactibvity Starttime_ Stoptime_ duration, i(uid) j(activity_number), I don't see all the correct values of Starttime_, Stoptime_, and duration. For example, the respondent with uid1 performs seven activities, but I see none after reshaping. Moreover, I see an activity for uid 2, although this respondent didn't perform any activities. Please see the attached image for reference. Any help is much appreciated.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float uid double(primaryactibvity Starttime_ Stoptime_ duration) 1 8 . . . 1 11 . . . 1 10 . . . 1 5 . . . 1 1 . . . 1 3 . . . 1 16 . . . 1 . . . . 1 . . . . end label values primaryactibvity primaryactibvity16 label def primaryactibvity16 1 "Collecting or managing water", modify label def primaryactibvity16 3 "Household chores", modify label def primaryactibvity16 5 "Market activities", modify label def primaryactibvity16 8 "Cooking/Meal preparation", modify label def primaryactibvity16 10 "Official Meetings", modify label def primaryactibvity16 11 "Bathing", modify label def primaryactibvity16 16 "Sleeping", modify
I am reshaping wide variables to long. However, after running the command reshape long primaryactibvity Starttime_ Stoptime_ duration, i(uid) j(activity_number), I don't see all the correct values of Starttime_, Stoptime_, and duration. For example, the respondent with uid1 performs seven activities, but I see none after reshaping. Moreover, I see an activity for uid 2, although this respondent didn't perform any activities. Please see the attached image for reference. Any help is much appreciated.
Comment