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

st: RE: generating simple index


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: generating simple index
Date   Thu, 25 Sep 2003 17:09:29 +0100

Vimalanand S. Prabhu
 
> I have a household data set with varying number of 
> respondents interviewed
> from a each household, like the following:
> 
> person hhid Age
> 1	1	12
> 2	2	25
> 3	2	52
> 4	3	62
> 5	4	77
> 6	4 	34
> 7 	4	32
> 8	4	23
> 9	5	18
> 10	5	13
> :
> :
> :
> 
> I wanted to convert the data from rows to columns...ie...I 
> wanted it in a
> form as follows:
> 
> hhid personid1 	age1 personid2 	age2 personid3 age3 ....
> 1	1		12
> 2	2		25	3		52
> 3	4		62
> 4	5		77	6		34	.......
> 5	10		13

Why? Most analyses will be much more difficult
like this. 

(-reshape- is one answer, but, to repeat, I don't think 
it will make your analysis much easier here.) 
 
> I would also like to know about some references for 
> advanced programming in Stata.

What is your definition of "advanced programming"? 
Something more advanced than the Programming manual [P]? 

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

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