Hello,
I am trying to reshape data from wide to long format.
We have 60 schools, each with up to 7 toilet blocks, each with up to 20 cubicles. I currently have a dataset with each observation being one of the 60 schools, and I want to get it to each row being a different cubicle.
When I reshape to get it to block level using
'reshape long blockuser blockdivided blockbin blockwater blockhandwash blocksoap blocktp numtoiletpaper numgirlscubicle numboyscubicle numsharedcubicle numcubicle cubicles_count, i(ID) j(block)'
it works, however for each block it gives me all the data on every block, as opposed to just the data for that block.
I want it so for block two the data for variables related to block 1 are missing.
I hope this makes sense
Thanks
Kathy
I am trying to reshape data from wide to long format.
We have 60 schools, each with up to 7 toilet blocks, each with up to 20 cubicles. I currently have a dataset with each observation being one of the 60 schools, and I want to get it to each row being a different cubicle.
When I reshape to get it to block level using
'reshape long blockuser blockdivided blockbin blockwater blockhandwash blocksoap blocktp numtoiletpaper numgirlscubicle numboyscubicle numsharedcubicle numcubicle cubicles_count, i(ID) j(block)'
it works, however for each block it gives me all the data on every block, as opposed to just the data for that block.
I want it so for block two the data for variables related to block 1 are missing.
I hope this makes sense
Thanks
Kathy
Comment