Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: How to find weighted median_st-svy

From   "Reda, Ayalu (Alumni)" <>
To   "" <>
Subject   st: How to find weighted median_st-svy
Date   Tue, 5 Feb 2013 03:44:23 +0100


I was analyzing the three DHS survey (2000, 2005, and 2011) data on Ethiopia.

The problem I am experiencing is that Stata wouldn't provide me the weighted medians in stsum. I have also tried the stdescribe command but to no avail. I know that there is a problem in these estimates since the values I am getting from the survival curves and the stsum command are different. Given the data, I also expect that the weighted survival times will be numbers with decimals as opposed to the whole numbers that stdescribe and stsum keep providing me.

I think that the the values in the Kaplan-Meier graph are somehow correctly weighted, where as those of the stdescribe and stsum are not.

Is there anyway other way that I could estimate the weighted medians? If this is not possible is there a wisdom in taking the median values of the K-M curve? If yes, how do I precisely do that? 

Many thanks in advance,


Here are the commands I applied:
/*...graph and calculate time to first marriage among women who had premarital sex.*/

svyset psuXyear [pweight=weight], strata(waveXstrata)
stset premsexmar2 [pweight=weight], failure(evermarrie)
stsum, by(source)
sort source
by source: stdescribe
sts graph, by(source) xlabel (1(1)6) tmin(0) tmax(7) xline( 3 6, lpattern(shortdash)) xtitle("risk period") title("Kaplan-Meier survival curves of time to first marriage among women who had premarital sex")

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index