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 #3237 is a reply to message #3203] Tue, 11 November 2014 11:33 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
Here is a response from Dr. Tom Pullum:
Quote:
Say that x is the name of a variable, such as age at marriage, and X is a specific value of that variable, e.g. 19.

If you look at how cumulative percentages are calculated, for any variable, in Stata (or in general), the cumulative percentage for variable x and value X is the percentage of cases with x less than or equal to X. For example, 48.37% is the percentage of cases with x<=19 and 56.12% is the percentage of cases with x<=20. I believe you were not including the "=" sign.

Age "19" is a one-year interval interpreted as age at last birthday. The upper boundary for age 19 is the exact day of the 20th birthday, which has an exact value is 20.00 (you can put as many zeroes after the decimal point as you want). That's why I said that 48.37% of women were married by exact age 20 and 56.12% by exact age 21. In terms of "exact" age, the median must be somewhere between 20.00 and 21.00. I gave the steps for finding the median, 20.2.

By the way, here's a trick that will save you some arithmetic. Paste the following lines into Stata:

input x P
20 48.37
. 50.00
21 56.12
end

regress x P
predict xhat
replace x=xhat if x==.
list x P, table clean

This will give the value of x for which P=50, i.e. the median.

 
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 14 08:46:20 Coordinated Universal Time 2025