Bookmark and Share

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: how to create a dummy with information across rows


From   ana mylena aguilar <anamylena@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: how to create a dummy with information across rows
Date   Thu, 5 Dec 2013 18:11:41 -0500

Hello
I have a datatset with information by households ( rows) and
individual household members in the columns.Household size can go all
the way until 25. Therefore, the format for x number of variables is
for example age1..age25.I reshaped the dataset to have household
members within each household in each row as below. However, I need to
contruct a variable that require using infomation across rows.
hh roster line age     rel with hh head            child's mother line
(only <14 years old)
1     1              35       household head
missing
1     2              15        daughter                                  missing
1     3              10        daughter                                  1
1     4               1         grandson                                 2
I need to create a dummy variable to identify a teen mother in the
household. In this case, there is one (line 2). The household is
formed by a mother, two daughters ( age 15 and 10) and a grandson. The
older daughter has a 1 year old child. Every child under 14 has
information on who is his/her biological mother ( roster line of the
mother). But I would like to link the information of the chidl with
the young mother.   Do I need to re-reshape or a loop would work?

Any help would be great, thanks
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index