Dear Stata Users,
This is my first time of working with survey data, and I am having some challenges with making my IDs uniquely identifiable. I am working on a survey dataset in Stata. The dataset contains an ID variable, another called preferred colour, and a host of other variables. Preferred colour is central to my study.
Regarding the preferred colour, IDs reported that they either prefer brown, white, purple, black or none. Since IDs listed different colours, the final dataset has a format where there is one observation per colour.
I need to reformat the data so that there is only one observation per ID. I read somewhere that I need to export separate excel sheets of the duplicates for each of the preferred colours, and then merge them into my main data, but how to even start. I will appreciate any hints that you can provide.
NB
I tried to get sample data using data dataex in 1/5 but it wasn't giving.
This is my first time of working with survey data, and I am having some challenges with making my IDs uniquely identifiable. I am working on a survey dataset in Stata. The dataset contains an ID variable, another called preferred colour, and a host of other variables. Preferred colour is central to my study.
Regarding the preferred colour, IDs reported that they either prefer brown, white, purple, black or none. Since IDs listed different colours, the final dataset has a format where there is one observation per colour.
I need to reformat the data so that there is only one observation per ID. I read somewhere that I need to export separate excel sheets of the duplicates for each of the preferred colours, and then merge them into my main data, but how to even start. I will appreciate any hints that you can provide.
NB
I tried to get sample data using data dataex in 1/5 but it wasn't giving.
Comment