I have done this many times with Excel and Java... This time I need to do it using Stata because it is more convenient to preserve variables' labels
. How can I restructure dataset_1 into dataset_2 below?
I need to transform the following dataset_1:
into dataset_2:
I know one way, which is a little awkward... I mean, I could expand
all the observations, then create variable obsNo
, and then, rename
variables...is there any better way?