Hi,
I have a dataset that I reshaped to be wide instead of long because I wanted a each row to be for a specific household ID and each column to represent age1, age2, age3, sex1, sex2, sex3, etc. Currently, age1 represents the age of the youngest child in the household and age2 is the second youngest, and so on. Sex1 is the sex of the youngest child. However, I want it to be ordered from oldest to youngest so that age 1 is the age of the oldest/1st child and so on. How can I do this?
Before I reshaped the data, I sorted it to be in descending order per household ID. But after the reshape, that was all changed. Can anyone help with this?
AC
I have a dataset that I reshaped to be wide instead of long because I wanted a each row to be for a specific household ID and each column to represent age1, age2, age3, sex1, sex2, sex3, etc. Currently, age1 represents the age of the youngest child in the household and age2 is the second youngest, and so on. Sex1 is the sex of the youngest child. However, I want it to be ordered from oldest to youngest so that age 1 is the age of the oldest/1st child and so on. How can I do this?
Before I reshaped the data, I sorted it to be in descending order per household ID. But after the reshape, that was all changed. Can anyone help with this?
AC
Comment