Statalist


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

RE: st: AW: Area under a percentile point


From   "Lachenbruch, Peter" <[email protected]>
To   <[email protected]>
Subject   RE: st: AW: Area under a percentile point
Date   Tue, 3 Feb 2009 08:45:46 -0800

Didn't we have a similar discussion last week - there was a modification of the percentile command - I think Nick Cox contributed to the discussion.

What we have here is a discrete random variable and this has generated the ties.  

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Tuesday, February 03, 2009 7:02 AM
To: [email protected]
Subject: AW: st: AW: Area under a percentile point


<> 

To break the ties you are complaining about, Jeph`s solution sounds good to
me. Also note http://www.stata.com/statalist/archive/2007-05/msg00767.html




HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Jeph Herrin
Gesendet: Dienstag, 3. Februar 2009 15:56
An: [email protected]
Betreff: Re: st: AW: Area under a percentile point


What you want is a bit strange, but here is how I would do it:

  sort myvar
  keep if _n<0.75*_N


hope this helps,
Jeph



zeynep elitaş wrote:
> Thanks for help, but this does not solve my problem.  As a simple
> example, lets assume we have a data set containing five 6's and five
> 7's. so the sample size is 10. Now if I wanted to keep the data values
> below the 75 th percentile, I would roughly have 7 observations
> remaining. However, following your suggestion I end up keeping all the
> observations.
> Thanks
> Zeynep Elitas
> 
> 2009/2/3 Martin Weiss <[email protected]>:
>> <>
>>
>> Let`s keep those below the 75 percentile of generated normal deviates...
>>
>> *************
>> clear*
>> set obs 1000
>> generate x=rnormal()
>> _pctile x, p(75)
>> keep if x<=r(r1)
>> *************
>>
>>
>>
>> HTH
>> Martin
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected]
>> [mailto:[email protected]] Im Auftrag von zeynep
elitas
>> Gesendet: Dienstag, 3. Februar 2009 14:28
>> An: [email protected]
>> Betreff: st: Area under a percentile point
>>
>> I have a simple question which I do not have the answer for. Is there
>> a way to tell Stata to keep the data under a certain percentile point
>> and drop the rest?  This is important since in my data a percentile
>> point has often the same value as the ones below and over it.
>>
>> Thanks
>> Zeynep Elitaş
>>
>> *
>> *   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/
> 
*
*   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/



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