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" <[email protected]>
To   <[email protected]>
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 
[email protected] 

[email protected]
 
> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index