Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72772

Reshaping into one line

$
0
0
Hello - I would like reshape my data from long into wide and end up having just one row.

I have

cluster x y

101 1 5
102 2 6
103 3 7
104 4 8

And I would like it to be

x101 y101 x102 y102 x103 y103 x104 y104
1 5 2 6 3 7 4 8


To me it seems as if i=j=cluster here and so I tried

reshape wide x y, i(cluster) j(cluster)

However, this gives me an error message in STATA saying that the variable cluster is not found.

Any idea what I am doing wrong and what the right command should be?

Thanks!!


Viewing all articles
Browse latest Browse all 72772

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>