Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: using weights for means of subgroups of the population


From   "Paolo Naticchioni" <paonat.stata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: using weights for means of subgroups of the population
Date   Sun, 15 Jul 2007 21:16:17 +0200

I forgot another issue.
I would like also to compute some quantile of the distribution, like
the 10th quantile, the median, the 90th percentile, etc.
as for the means, I can use egen
bysort year gender education: egen p90=pctile(wage), p(90)
However, also in this case it is not possible to use weights, the
consider the weighted distribution.
Someone knows how to do all that?
thanks
P.
PS I have also used collapse, but also in this case it is not possible
to use weights for means



2007/7/15, Paolo Naticchioni <paonat.stata@gmail.com>:
> dear all,
> my question s the following.
> I want to create a new variable including the means for some groups
> (strata) of the population.
> For instance, assume my strata are year, gender, education.
>
> Using egen I can compute the average of some outcome variable, for
> instance wage, using the following:
>
> bysort year gender education: egen average=mean(wage)
>
> However, using egen I cannot use any types of weights. I would like to
> use weights (weights with average 1). Do you know how can I introduce
> weights in a easy way? Probably it is very easy, but I do not know the
> command.
>
> Thanks in advance
> Paolo
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index