Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: using reshape / xpose


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: using reshape / xpose
Date   Mon, 11 Dec 2006 11:36:09 -0600

-reshape wide v3, i(ID) j(v2) string-

-renpfix v3 -

Scott


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Mingfeng Lin
> Sent: Monday, December 11, 2006 11:22 AM
> To: [email protected]
> Subject: st: using reshape / xpose
> 
> This might actually be a very simple question but I still couldn't
> figure out after I tried the reference and the Statalist archive.  I
> have a dataset that looks like this:
> 
> ID        v2           v3
> 1         abc         99
> 1         dce         812
> 1         kdje        282
> 2         abc         33
> 2         dce         221
> 2         kdje        772
> ....
> 
> 
> And I am trying to change it into this format:
> 
> ID       abc         dce          kdje
> 1        99           812          282
> 2        33           221          772
> ....
> 
> There are over 1000 variables for each ID (those like abc, dce, kdje
> in the example above), and I would really like to keep the original
> variable names.  I also tried -xpose-, but then the variable names
> (like abc, dce, kdje) became missing in the new dataset.  Is there a
> quick way to do this?
> 
> Thanks very much for your help!
> 
> Mingfeng



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index