[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: survey median estimator
As Nick Cox points out, -egen- can't be combined with pweights. But
-pctile- does accept pweights. Unfortunately, -pctile- is not compatible
with -by-. One possibility would be to hack the code of -pctile- and make
it byable--I haven't looked to see how easy or hard that would be.
Another possibility is to loop on the values of the grouping variable
"type." The resulting medians should be properly estimated. The standard
errors would probably be incorrect because -pctile- will not account for
the stratification and clustering--but based on the wished for model of
-egen median=median(edpct) if salquart==3, by(type)- that is probably not
of concern here.
Hope this helps.
Dept. of Family Medicine & Community Health
Albert Einstein College of Medicine
Bronx, NY, USA
* For searches and help try: