Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Inverse Cummulative Variable


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Inverse Cummulative Variable
Date   Sun, 11 Mar 2012 12:42:26 +0000

Specifically, however, you want frequencies >= value. Best to negate
your variable before calling -cumul-:

gen work = -employees
cumul work , gen(freq) freq equal
tabdisp employees, c(freq)
drop work

Note that what you want is more commonly called the reverse, converse
or complementary cumulative frequency. Calling it "inverse" runs a big
risk of confusion with the quantile function.

Nick

On Sun, Mar 11, 2012 at 12:30 PM, Nick Cox <njcoxstata@gmail.com> wrote:

> The -cumul- command is devoted to this question.
>
> For corresponding graphs, see -distplot- (SJ).

 On Sun, Mar 11, 2012 at 12:05 PM, Arantxa Crespo Rodriguez
 <acrodrig@eco.uc3m.es> wrote:
>
>> I have a dataset of firms with the number of employees for each one.
>> I wanna create a variable that tells me how many firms have more or
>> the same number of employees than the current observation.
>> Example:
>>
>> Firm id   Employees  Inverse Cumulative
>> 101         10           9
>> 102         20           8
>> 103         20           8
>> 104         37           6
>> 105         38           5
>> 106         52           4
>> 107         52           4
>> 108         52           4
>> 109         60           1

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index