Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Exported FLAT file and multiple records
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
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
[email protected]
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/