Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: pweights in xtiles command are doing the opposite of what I expect them to do

 From Michael Boehm To statalist@hsphsun2.harvard.edu Subject Re: st: pweights in xtiles command are doing the opposite of what I expect them to do Date Wed, 2 Feb 2011 11:23:06 +0000

```Steve,

Thanks for this nonetheless. Using your example data I figured out
that Stata was doing the "right" thing. The problem was that,
adjusting for response rates in follow up surveys, ELS does in fact
have a sample that is skewed towards individuals who are higher up the
test score distribution in the population. Therefore, the results that
Stata produces are correct.

Thanks a lot for that again,
Michael

On Wed, Feb 2, 2011 at 4:22 AM, Steven Samuels <sjsamuels@gmail.com> wrote:
> --
> Sorry,  my example didn't represent your data, where the lower ranking group
> has the smaller weight.
>
>
> Michael--
>
> Steve
>
> Steven J. Samuels
> sjsamuels@gmail.com
> 18 Cantine's Island
> Saugerties NY 12477
> USA
> Voice: 845-246-0774
> Fax:    206-202-4783
>
> On Feb 1, 2011, at 10:02 AM, Michael Boehm wrote:
>
> Dear all,
>
> I am trying to compute students' quantiles in the cognitive skill
> distribution using their test results reported in a survey, the
> Educational Longitudinal Study (ELS). The ELS oversamples individuals
> who are of less privileged social background, which comes with lower
> test scores. Therefore, individuals should be higher up in the skill
> distribution within the sample than compared to the whole population.
> If I adjust for the survey design, using the inverse probability of
> being selected for the survey, I however get the opposite result. For
> example, I would expect the mean of centil to be below centil1 and
> below 50.
>
> xtile centil =  F1TXMSTD if G12COHRT != 0 [pweight =  F2F1WT], nq(100)
> xtile centil1 =  F1TXMSTD if G12COHRT != 0 & F2F1WT != 0 , nq(100)
>
> summarize centil centil1
>
>  Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>    centil |     12011    53.20806    28.94271          1        100
>   centil1 |     12011    50.48081    28.86572          1        100
>
> What am I doing wrong here?
>
> Thanks
> Michael
> *
> *   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/
```