Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Converting the values of a variable into variables


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Converting the values of a variable into variables
Date   Thu, 24 Nov 2005 18:39:06 -0000

This is a -reshape-. 

reshape wide datavalue, i(id) j(datadefinition) string
renpfix datavalue 

See -help reshape-, [D] reshape, -search reshape- 

Nick 
n.j.cox@durham.ac.uk 

sdm1@york.ac.uk
 
> I have a data set of the form:
> 
> id datadefiniton datavalue
> 1   income          1000
> 1   age               64
> 1   weight           125
> 2   income          1500
> 2   age               44
> 2   weight           165
> 
> which I want to convert to the form:
> 
> id income age weight 
> 1   1000    64   125
> 2   1500    44   165
> 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index