The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Calculating median age at first sex and percentage of respondents with sex before the age of 15
Calculating median age at first sex and percentage of respondents with sex before the age of 15 [message #11972] Tue, 14 March 2017 10:26 Go to previous message
chichi is currently offline  chichi
Messages: 9
Registered: March 2017
Member
Hello!
I am using the Namibian DHS 2013. I created one dataset with the women's, the men's and the HIV data.
I want to calculate the median age at first sex intercourse by women and men in the age group 25-49. First I checked if I have the same number of women and men as in the final report of 2013.

This was my stata code:
tab v525 if v012 > 24 & v012 < 50 [iweight=wgt1], miss

I had 7.776 respondents like in the report. Then for calculating the median I used this code:

by gender, sort : summarize v525 if v012 > 24 & v012 < 50 [aweight = wgt1], detail

The median number which came out was the same as in the report. But the number of observations for men and women was different. Overall I had 7.746 respondents, 30 respondents fewer than in the report. Can someone tell what I made wrong?

Further I want to get out the percentage of women and men who had sex before the age of 15.
my code was:

by gender, sort: tab v525 if v012 > 24 & v012 < 50 [iweight=wgt1], missing

My result was 7.9% for women and 12.5% for men, while the report indicated 5.0% for women and 10.1% for men in the age group 25-49 years.

It would be great if someone could help me or have a stata code for my intention! Thank you!
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DECOMPOSING ERREYGERS CONCENTRATION INDEX - STATA
Next Topic: I need help constructing a variable in Stata
Goto Forum:
  


Current Time: Fri Mar 29 03:06:19 Coordinated Universal Time 2024