Applied statistics/Tutorials: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Nick Gardner
No edit summary
imported>Nick Gardner
No edit summary
Line 18: Line 18:
==The false positive question==
==The false positive question==
The question:<br>
The question:<br>
If a test of a disease that has a prevalence rate of 1 in 1000 has a false positive rate of 5%, what is the chance that a person who has positive result actually has the disease.<br>
If a test of a disease that has a prevalence rate of 1 in 1000 has a false positive rate of 5%, what is the chance that a person who has been given a positive result actually has the disease.<br>
The answer:<br>
The answer:<br>
2%<br>
2%<br>
Proof:<br><small>
Proof:<br><small>
Let A denote the event of having the disease and, B the event of having been tested positive (for the purpose of applying Bayes'theorem).
Let A denote the event of having the disease and, B the event of having been tested positive (for the purpose of applying Bayes'theorem),<br>
Then P(B/A) which is the probability of having been tested positive when having the disease, can be taken asequal to 1;<br>
Then P(B/A) which is the probability of having been tested positive when having the disease, can be taken as equal to 1;<br>
And  P(A) is the probability of having the disease, which with a prevalence of 1 in 1000 must be equal to 1/1000<<br>
And  P(A) is the probability of having the disease, which with a prevalence of 1 in 1000 must be equal to 1/1000<<br>
And  P(B) is the probability of being tested positive, which can be arrived at by 3 steps:<br>
And  P(B) is the probability of being tested positive, which can be arrived at by 3 steps:<br>
Line 31: Line 31:
::P(B) = 999/1000 multiplied by 1/20 or, near enough 1/20.<br>
::P(B) = 999/1000 multiplied by 1/20 or, near enough 1/20.<br>
So applying Bayes' theorem, the probability of having the disease, given that you have been tested positive is given by  
So applying Bayes' theorem, the probability of having the disease, given that you have been tested positive is given by  
::: P(A/B)&nbsp;=&nbsp;P(B/A)&nbsp;x&nbsp;P(A)/P(B), or:
::: P(A/B)&nbsp;=&nbsp;P(B/A)&nbsp;x&nbsp;P(A)/P(B), &nbsp;or:
::::&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp;(1/1000)/(1/20) - which is 0.02, or 2%.
::::&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp;(1/1000)/(1/20) &nbsp;&nbsp;- which is 0.02, or 2%.
</small>
</small>

Revision as of 11:21, 29 June 2009

This article is developing and not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
Tutorials [?]
 
Tutorials relating to the topic of Applied statistics.

Rules of chance

The addition rule

For two mutually exclusive events, A and B,
the probability that either A or B will occur is equal to the probability that A will occur plus the probability that B will occur,

P(A or B) = P(A) + P(B).

The multiplication rule

For two independent (unrelated) events, A and B,
the probability that A and B will both occur is equal to the probability that A will occur multiplied by the probability that B will occur,

P(A and B) = P(A) x P(B)

Bayes' theorem

The probability that event A will occur, given that event B has occurred is equal to the probability that B will occur, given that A has occurred, mutiplied by the probability that A will occur divided by the probability that B will occur,

P(A/B) = P(B/A) x P(A)/P(B).

The false positive question

The question:
If a test of a disease that has a prevalence rate of 1 in 1000 has a false positive rate of 5%, what is the chance that a person who has been given a positive result actually has the disease.
The answer:
2%
Proof:
Let A denote the event of having the disease and, B the event of having been tested positive (for the purpose of applying Bayes'theorem),
Then P(B/A) which is the probability of having been tested positive when having the disease, can be taken as equal to 1;
And P(A) is the probability of having the disease, which with a prevalence of 1 in 1000 must be equal to 1/1000<
And P(B) is the probability of being tested positive, which can be arrived at by 3 steps:
Step 1 is to observe that since the prevalence of the disease is 1 in 1000, 999 persons out of every 1000 are healthy.
Step 2 is to recall that for each healthy person the probability of being tested positive is 5% or 1 in 20.
Step 3 is to apply the multiplication rule and get the answer:

P(B) = 999/1000 multiplied by 1/20 or, near enough 1/20.

So applying Bayes' theorem, the probability of having the disease, given that you have been tested positive is given by

P(A/B) = P(B/A) x P(A)/P(B),  or:
   =     1    x  (1/1000)/(1/20)   - which is 0.02, or 2%.