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

From |
Richard Ochmann <rochmann@diw.de> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: RE: using xtile and qreg to find the median income for individuals between certain income percentiles |

Date |
Thu, 24 Sep 2009 16:38:18 +0200 |

<> what about: *** #delimit; _pctile pincp [aweight=pwgtp] if agerange==1 & puma=="02200" & dropout==1, nq(10); sum pincp [aweight=pwgtp] if agerange==1 & puma=="02200" & dropout==1 & pincp >= r(r1) & pincp < r(r2), de; di "`r(p50)'"; di "`r(sum_w)'"; *** greets, rich owner-statalist@hsphsun2.harvard.edu schrieb am 24.09.2009 15:58:04: > Yes - that works. Thanks. However, output generated after the sum > command shows N to be my sample, and not the estimated population. Thoughts? > > -----Original Message----- > From: Nick Cox [mailto:n.j.cox@durham.ac.uk] > Sent: Thursday, September 24, 2009 5:25 AM > To: statalist@hsphsun2.harvard.edu > Subject: st: RE: using xtile and qreg to find the median income for > individuals between certain income percentiles > > Why not just use -summarize, detail- with -aweights-? > > Nick > n.j.cox@durham.ac.uk > > Holly Kosiewicz, M.A. > > I have a database that contains information on a sample of individuals. > The database includes a final weight that is used to produce estimates > for the population. > > I have to used the xtile command to generate 10 percentiles for a > variable that measures income conditioned on a group of individual > characteristics: working age, dropout, and lives in a particular area; > the exact command I use is: > xtile ten=pincp [aweight=pwgtp] if agerange==1 & puma=="02200" & > dropout==1,nq(10) > > I would like to find the weighted median income for individuals that > fall between the 1-10th percentile, 11th-20th percentile, 21-30th > percentile of the income variable. > > Martin, Nick, and Austin have shown me that the qreg command can be used > to obtain the median income level for the entire population. I have > tried to use this command to find the median income for individuals that > fall between certain income percentiles, but Stata gives me an error > stating that my income variable is dropped due to collinearity > (something I should have expected from the get-go). This is the command > I use: qreg pincp [aweight=pwgtp] if agerange==1 & puma=="02200" & > dropout==1 & ten==1 > > I have looked at different posts about topics dealing with percentiles > and weights but none of them directly tackles this issue. > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: RE: RE: using xtile and qreg to find the median income for individuals between certain income percentiles***From:*Holly Kosiewicz <HKosiewicz@epe.org>

- Prev by Date:
**st: Cannot initialize matrix to store summed coefficient estimates** - Next by Date:
**st: AW: Cannot initialize matrix to store summed coefficient estimates** - Previous by thread:
**st: RE: RE: using xtile and qreg to find the median income for individuals between certain income percentiles** - Next by thread:
**st: svyset problem 1** - Index(es):

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