Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: cumulative in reverse order


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: cumulative in reverse order
Date   Fri, 6 Jun 2003 14:05:20 +0100

Lachenbruch, Peter
> 
> A clumsier method for getting a reverse cumulative could be
> 
> Replace x=-x
> Cmul x,gen(xcum)
> Replace x=-x
> List x xcum
> 
> Or
> Cmul x,gen(xcum)
> Replace xcum=1-xcum

Here by -Replace- Peter (a.k.a. Tony) means -replace- and 
by -Cmul- he means -cumul-, I imagine.  

However, there are two pitfalls here, one slightly subtle, 
one more obvious. 

1. As it stands, -cumul- does not produce equal values 
of cumulative probability for equal values of the input 
variable. I suggested in an earlier posting that there 
be a new -equal- option which enforces this. This will be 
added in the next ado update from Stata. 

2. -list-ing the whole data set could be space-consuming. 

tabdisp x, c(xcum) 

would select distinct values once only -- once the 
issue in 1 is taken care of. 

Nick 
[email protected] 
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index