Project

General

Profile

Actions

Support #22

closed

Matching parent's information to their children (aged >15) in the same household

Added by Maren M. Michaelsen almost 13 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Redmine Admin
Category:
Data analysis
Start date:
02/01/2012
% Done:

50%


Description

Dear Understanding Society survey/BHPS users,

I am matching parent's information on age to their children (aged >15) in the same household using STATA.

The results show that in 192 (about 5%) of the cases the child is at least as old as the mother (same for some fathers). Also, there are several male mothers and female fathers.

Please find below the commands I am using to match household and individual data and the results.

Please let me know whether I made a mistake or if there are indeed errors in the data.

Maren

/* Merge data sets for cross-section */
/* a_indresp.dta */
use data/a_indresp.dta, clear
sort a_hidp pidp
save data/indresp_sorted.dta, replace
file data/indresp_sorted.dta saved
/* a_indall.dta */
use data/a_indall.dta, clear
sort a_hidp pidp
save data/indall_sorted.dta, replace
file data/indall_sorted.dta saved
/* merge sorted datasets */
merge 1:1 a_hidp pidp using data/indresp_sorted.dta, keep(3)
Result                           # of obs.
-----------------------------------------
not matched 0
matched 50,994 (_merge==3)
-----------------------------------------
cap drop _merge     
/* Merge prents information on children */
bysort a_hidp (pidp): gen m_sex                 =     a_sex[a_mnspno]
(45333 missing values generated)
bysort a_hidp (pidp): gen m_dvage               =   a_dvage[a_mnspno]
(45333 missing values generated)
sum a_dvage m_dvage if a_dvage >= m_dvage
Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
a_dvage | 192 23.28125 8.068039 16 69
m_dvage | 192 22.38021 7.588654 16 69
Actions

Also available in: Atom PDF