Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Exported FLAT file and multiple records


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Exported FLAT file and multiple records
Date   Thu, 21 Jun 2012 16:39:10 +0100

Sounds like a -reshape-. 

. help reshape 

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

Ulises Huerta Munoz

I am using Stata 12 and data from the Demographic Health Survey.
To assign mother characteristics to children I have done a 1:m merge using
the children's file as the base file. Since this is an exported  "FLAT" file,
multiple or repeating records are placed one after the other on the record
with each occurrence of every such variable having its own name. So for
example, a woman with three children whose height we are interested in shows as:


     v001 v002 v003 child#1height child#2height child #3height
1.     X      Y      Z             98                  72             126


to regress the height of children and use characteristics of the mom
as predictors, I
need each children to have the characteristics of the mom such as

     v001 v002 v003 child height
1.     X      Y      Z             98
2.     X      Y      Z             72
3.     X      Y      Z             126

Is there a command that will allow me to do this?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index