The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Calculating Median Ages
Re: Calculating Median Ages [message #2470 is a reply to message #2468] Tue, 24 June 2014 15:54 Go to previous messageGo to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear Hannah,
Here is a response from one of our experts, Dr. Tom Pullum:
* Kenya 2008-09 survey report, page 83, table 6.3, median age at first
* marriage for women currently 25-29 is 20.2. Try to replicate.

use KEIR53FL.dta

set more off
keep if v013==3

keep v000-v012 v507-v512

describe

* afm is completed years of age at first marriage
gen afm=int((v509-v011)/12)
tab afm,m

tab afm [iweight=v005/1000000],m

* look at the cumulative %; it is 48.37 by exact age 20 and 56.12 by exact age 21.

scalar mafm=20+1*(50-48.37)/(56.12-48.37)

scalar list mafm

* The value is 20.2

* There are more automated ways to do this. If you try to do it with the cumul command,
* you must set the missing ages at marriage (i.e. not married) to some high numerical
* value sucn as 99

* Note that the median as defined by stata would be 20, an integer.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postpartum check while still in facility (Benin)
Next Topic: Calculating Confidence Interval
Goto Forum:
  


Current Time: Tue Jan 28 00:22:03 Coordinated Universal Time 2025