[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

R: st: R: probability question

From   "Carlo Lazzaro" <>
To   <>
Subject   R: st: R: probability question
Date   Thu, 12 Jun 2008 09:30:52 +0200

Dear Richard e Svend,
thanks a lot for your further clarifications on this classic
By the way I was wondering whether it may be interesting to add to the Stata
bookshelf a tutorial-based textbook on probability (let's say from basics to
Bayesian probability distributions) issues related to biostatistics,
epidemiology, social sciences and alike (with alike I mean all the research
fields which are unknown for me) which can be tackled with Stata routines.

(This is not an advertising stunt to promote myself as an author: this idea
is indeed the offspring of my hard times in dealing with the quantitative

Kind Regards,

-----Messaggio originale-----
[] Per conto di Svend Juul
Inviato: giovedý 12 giugno 2008 8.51
Oggetto: Re: st: R: probability question 

Moleps asked, and Carlo and Richard commented:

I need to calculate the probability of the following event:
That at least one patient out of 99 suffers from kidneycancer
(incidence 15/100000 pr year) over a time period of 15 years.



searching the literature (Briggs A, Sculpher M, Claxton K. Decision
Modelling for Health Economic Evaluation. Oxford: Oxford University
2006:51) I have found out a formula for converting rate into



r= instantaneous rate, provided that it is constant over the period of
interest (t)



That might be more accurate than what I calculated before, but luckily
it gives pretty much the same result. For one person, the probability of
NOT getting cancer over 15 years is

p(0) = 1 - (1 - exp(-rt)) = exp(-rt) = exp(-15/100000 * 15), i.e.

. di exp(-15/100000 * 15)

The probability that all 99 people should be so lucky is

. di exp(-15/100000 * 15) ^ 99

Hence, the probability that at least one is not so lucky is

. di 1 - (exp(-15/100000 * 15) ^ 99)

Which is pretty close to my earlier calculation, which was

. di 1 - ((1 - 15/100000 )^15^99)

The difference is .00001337!

I imagine there might be some other complications in these calculations.
The rate may not be constant across time; or people may die from
something else before they get kidney cancer. But for the problem as
stated, it sounds like there is a 20% chance of at least one person
getting kidney cancer.


To get the expected proportion over 15 years, 15*15/100000 = 0.00225 
is almost right with a rare event, but as Carlo pointed out, the 
correct conversion from a rate to a proportion says:

    . display 1-exp(-15/100000 * 15)

Now, the official -bitest- command does the rest of the job:

   . bitesti 99 1 0.00224747

           N   Observed k   Expected k   Assumed p   Observed p
          99          1     .2224995       0.00225      0.01010

     Pr(k >= 1) = 0.199685  (one-sided test)
     Pr(k <= 1) = 0.978786  (one-sided test)
     Pr(k >= 1) = 0.199685  (two-sided test)

     note: lower tail of two-sided p-value is empty

Pr(k >= 1) = 0.199685


Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone:  +45 8942 6090
Home:   +45 8693 7796

*   For searches and help try:

*   For searches and help try:

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