# How to create variable for mother's age using ipums dataset in STATA

**URL:** <https://forum.ipums.org/t/how-to-create-variable-for-mothers-age-using-ipums-dataset-in-stata/899>\
**Category:** General\
**Created:** [May 25, 2015, 1:43pm UTC](https://forum.ipums.org/t/how-to-create-variable-for-mothers-age-using-ipums-dataset-in-stata/899 "2015-05-25T13:43:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![obrienpn](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@obrienpn](https://forum.ipums.org/u/obrienpn)\
**Post date:** [May 25, 2015, 1:43pm UTC](https://forum.ipums.org/t/how-to-create-variable-for-mothers-age-using-ipums-dataset-in-stata/899/1 "2015-05-25T13:43:00Z")

</div>

I want to crosstab age of children classified by single years from age 0 to 14, and age of mothers classified by single years also, using the South African 2007 and 2001 samples.

The question to the above would for example be; “How many 5 year olds today whose mothers are aged 30?” The mother does not necessarily have to be part of the household because i want to use the information to estimate fertility by reverse method (own child method)

To do this, it appears I need a variable in children’s records which links the child to age of the mother. In the samples’ variables, can I use momloc? And how should the STATA command be like exactly? I have tried the one below but the outcome doesn’t seem right because when I tab it ‘mage’ starts at 0 (zero).

bysort UqNr Q420per: gen mage =age[Q14cmpsn]

---

<div class="post-metadata">

**Author:** ![Tim\_Moreland](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tim\_Moreland](https://forum.ipums.org/u/Tim_Moreland)\
**Post date:** [May 28, 2015, 6:54pm UTC](https://forum.ipums.org/t/how-to-create-variable-for-mothers-age-using-ipums-dataset-in-stata/899/2 "2015-05-28T18:54:00Z")

</div>

It is possible to create a variable within the IPUMS data extract system that contains the age of a respondent’s mother by utilizing the [Attach Characteristics](https://international.ipums.org/international-action/faq#ques42) option. To do so, you should first select your samples and variables, which must contain [AGE](https://international.ipums.org/international-action/variables/AGE#description_section). Before submitting your extract, you will be given the option to choose “Attach characteristics” on the [extract request screen](https://international.ipums.org/international-action/extract_requests/summary). Check the box for “Mother” on the AGE row. This will add a variable to your data extract request called AGE\_MOM. Now simply submit your extract. Keep in mind that the age of a respondent’s mother can be [identified](https://forum.ipums.org/t/what-is-the-universe-for-attached-characteristics-of-mother-and-father/600/1) only if the mother and child belong to the same household.

Hope this helps.
