[R] Usage of p/d/qnorm
Martyn Plummer
plummer at iarc.fr
Wed Jan 12 17:35:32 CET 2000
On 12-Jan-00 ralf.herold at charite.de wrote:
> Hello,
>
> could You please help: I am looking for a way to formulate test accuracy
> measures such as test sensitivity, specificity, predictive values, and
> correct classification rate using p/d/qnorm. The tests' primary values
> follow a bimodal distribution, which is modelled by a mixture of two normal
> distributions:
>
> p * dnorm ((x - u1) / s1) / s1 +
> (1 - p) * dnorm ((x - u2) / s2) / s2)
>
> {written like in Venables & Ripley, 2nd Ed., p. 288}. So, the first and
> second summand would correspond to truly negative and positive status,
> respectively, whereas the test would be termed negative or positive with
> respect to a varying x cut off value.
>
> How could one possibly formulate using p/d/qnorm e.g. the specificity:
> f(x)= number of positive tests at cut off x / total number of truly
> positives ?
That's not the specificity. It looks like (an estimate of) the
sensitivity, except the numerator should be the number of truly positives
who test positive.
Sensitivity = Pr (Test status +ve | True status +ve)
= 1 - pnorm((x-u2)/s2)
Specificity = Pr (Test status -ve | True status -ve)
= pnorm((x-u1)/s1)
The mixture proportions are irrelevant, since you're conditioning
on true status. (I'm assuming that u2 > u1 and values above x are
considered positive. This is true in every example I've seen).
Martyn
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list