PBayes: calculate a probability from Bayes Theorem.

Description Usage Arguments Details Examples

Description

PBayes(Dis, TruePos = NULL, FalsePos= NULL, TrueNeg= NULL, FalseNeg= NULL)

Usage

1
2
PBayes(Dis, TruePos = NULL, FalsePos = NULL, TrueNeg = NULL,
  FalseNeg = NULL)

Arguments

Dis

the occurence of the disease

TruePos

proportion of true positives (sensitivity)

FalsePos

proportion of false positives

TrueNeg

proportion of true negatives (specificity)

FalseNeg

proportion of false negatives

Details

Three probabilities are required required: probability of someone having the disease and then two others, e.g. true positive and false positive probabilities.

Examples

1
2
3
4
5
6
7
# Say 1 in 10,000 have a disease. A test correctly identifies it 98% of the time
# but also suggests it is present when it isn't in 3% of cases. If someone gets
# positive result from the test, what's the probability they have the disease?

PBayes(1/10000, TruePos=0.98, FalsePos=0.03)

# answer is 0.33%

helophilus/ColsTools documentation built on May 30, 2019, 4:03 p.m.