Dear Richard e Svend,
thanks a lot for your further clarifications on this classic
classwork-issue.
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
world!)
Kind Regards,
Carlo
-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Svend Juul
Inviato: gioved� 12 giugno 2008 8.51
A: [email protected]
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.
====================
Carlo:
searching the literature (Briggs A, Sculpher M, Claxton K. Decision
Modelling for Health Economic Evaluation. Oxford: Oxford University
Press,
2006:51) I have found out a formula for converting rate into
probabilities:
p=1-exp(-rt)
where:
p=probability;
r= instantaneous rate, provided that it is constant over the period of
interest (t)
======================
Richard:
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)
.99775253
The probability that all 99 people should be so lucky is
. di exp(-15/100000 * 15) ^ 99
.8003149
Hence, the probability that at least one is not so lucky is
. di 1 - (exp(-15/100000 * 15) ^ 99)
.1996851
Which is pretty close to my earlier calculation, which was
. di 1 - ((1 - 15/100000 )^15^99)
.19969847
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)
.00224747
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
__________________________________________
1
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
Email: [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/
*
* 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/