Dear Statalisters,
I have a dataset in long format as follows:
Note that this is just a snippet of the example, and it continues in the pattern above. Thus my data is uniquely identified with 3 variables. I'd like to change this dataset into the following format:
I'd have used reshape wide data, i(x) j(y) if it was only two variables, but now that there's 3 variables that uniquely identifies the data, I'm at a loss. I'd like to use by, but Stata doesn't allow by with reshape.
How can I change the dataset to wide? Any help will be appreciated.
I have a dataset in long format as follows:
Code:
clear input float(x y z data) 1 1 1 15 1 1 2 -10 1 1 3 7 1 2 1 9 1 2 2 3 1 2 3 0 1 3 1 8 1 3 2 13 1 3 3 6 2 1 1 21 end
Code:
clear input float(x y data_1 data_2 data_3) 1 1 15 -10 7 1 2 9 3 0 1 3 8 13 6 2 1 21 . . end
How can I change the dataset to wide? Any help will be appreciated.
Comment