Bookmark and Share

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


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

st: RE: Cumulative Distribution Function (CDF)


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Cumulative Distribution Function (CDF)
Date   Mon, 7 Feb 2011 17:40:34 +0000

This message came bound up with e-junk, HTML and a .gif. Plain text (ASCII) only please. 

I don't understand "cannot find it", but any way it's there. Here -groups- (SSC) is used in passing. 

. sysuse auto
(1978 Automobile Data)

. cumul mpg, gen(cumpg) equal

. groups mpg cumpg

  +----------------------------------+
  | mpg      cumpg   Freq.   Percent |
  |----------------------------------|
  |  12    .027027       2      2.70 |
  |  14   .1081081       6      8.11 |
  |  15   .1351351       2      2.70 |
  |  16   .1891892       4      5.41 |
  |  17   .2432432       4      5.41 |
  |----------------------------------|
  |  18   .3648649       9     12.16 |
  |  19    .472973       8     10.81 |
  |  20   .5135135       3      4.05 |
  |  21   .5810811       5      6.76 |
  |  22   .6486486       5      6.76 |
  |----------------------------------|
  |  23   .6891892       3      4.05 |
  |  24   .7432432       4      5.41 |
  |  25   .8108108       5      6.76 |
  |  26   .8513514       3      4.05 |
  |  28   .8918919       3      4.05 |
  |----------------------------------|
  |  29   .9054054       1      1.35 |
  |  30   .9324324       2      2.70 |
  |  31   .9459459       1      1.35 |
  |  34   .9594595       1      1.35 |
  |  35   .9864865       2      2.70 |
  |----------------------------------|
  |  41          1       1      1.35 |
  +----------------------------------+

. duplicates list mpg cumpg

Duplicates in terms of mpg cumpg

  +--------------------------------+
  | group:   obs:   mpg      cumpg |
  |--------------------------------|
  |      1     26    12    .027027 |
  |      1     27    12    .027027 |
  |      2     11    14   .1081081 |
  |      2     12    14   .1081081 |
  |      2     28    14   .1081081 |
  |--------------------------------|
  |      2     30    14   .1081081 |
  |      2     33    14   .1081081 |
  |      2     64    14   .1081081 |
  |      3      5    15   .1351351 |
  |      3     31    15   .1351351 |
  |--------------------------------|
  |      4      9    16   .1891892 |
  |      4     15    16   .1891892 |
  |      4     22    16   .1891892 |
  |      4     41    16   .1891892 |
  |      5      2    17   .2432432 |
  |--------------------------------|
  |      5     23    17   .2432432 |
  |      5     53    17   .2432432 |
  |      5     74    17   .2432432 |
  |      6      6    18   .3648649 |
  |      6     21    18   .3648649 |
  |--------------------------------|
  |      6     32    18   .3648649 |
  |      6     38    18   .3648649 |
  |      6     46    18   .3648649 |
  |      6     47    18   .3648649 |
  |      6     48    18   .3648649 |
  |--------------------------------|
  |      6     67    18   .3648649 |
  |      6     69    18   .3648649 |
  |      7     10    19    .472973 |
  |      7     19    19    .472973 |
  |      7     36    19    .472973 |
  |--------------------------------|
  |      7     37    19    .472973 |
  |      7     39    19    .472973 |
  |      7     49    19    .472973 |
  |      7     50    19    .472973 |
  |      7     51    19    .472973 |
  |--------------------------------|
  |      8      4    20   .5135135 |
  |      8      8    20   .5135135 |
  |      8     34    20   .5135135 |
  |      9     13    21   .5810811 |
  |      9     25    21   .5810811 |
  |--------------------------------|
  |      9     35    21   .5810811 |
  |      9     59    21   .5810811 |
  |      9     60    21   .5810811 |
  |     10      1    22   .6486486 |
  |     10      3    22   .6486486 |
  |--------------------------------|
  |     10     16    22   .6486486 |
  |     10     17    22   .6486486 |
  |     10     29    22   .6486486 |
  |     11     54    23   .6891892 |
  |     11     56    23   .6891892 |
  |--------------------------------|
  |     11     70    23   .6891892 |
  |     12     18    24   .7432432 |
  |     12     40    24   .7432432 |
  |     12     52    24   .7432432 |
  |     12     58    24   .7432432 |
  |--------------------------------|
  |     13     44    25   .8108108 |
  |     13     55    25   .8108108 |
  |     13     61    25   .8108108 |
  |     13     72    25   .8108108 |
  |     13     73    25   .8108108 |
  |--------------------------------|
  |     14      7    26   .8513514 |
  |     14     45    26   .8513514 |
  |     14     65    26   .8513514 |
  |     15     24    28   .8918919 |
  |     15     42    28   .8918919 |
  |--------------------------------|
  |     15     62    28   .8918919 |
  |     16     20    30   .9324324 |
  |     16     63    30   .9324324 |
  |     17     57    35   .9864865 |
  |     17     66    35   .9864865 |
  +--------------------------------+

Nick 
[email protected] 

[email protected]

I want to calculate the Cumulative Distribution Function (CDF) using - cumul - and cannot find the -equal- option to assign the same cumulative probability to each tied value. 
I am using stata 11 and read that in 2003 -equal- option was added to -cumul- (as stated in http://www.stata.com/support/faqs/stat/pcrank.html), however I cannot find it.

Any idea of an option to assign the same cumulative probability to each tied value when using - cumul- ?

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