help ppp

Title

ppp — Plot pre- and post-test probabilities after diagnostic testing

Syntax

ppp prevalence LR+ LR−
[, options]

or

ppp prevalence sensitivity specificity
[, nolr options]

Description

ppp is an immediate command to plot a nomogram-like graph showing how
pre-test probability evolves to post-test probability after one or more
diagnostic tests. The method is based on Bayes’ theorem and is similar in spirit to the
fagan plot, but allows sequential tests (“triages”).

The ppp command requires Stata 10.1 or later versions.

The first three arguments are;

prevalence - The prior/pre-test probability (between 0 and 1),

lrp - The likelihood ratio for positive results (values >0),

lrn - The likelihood ratio for negative results (values >0).

or alternatively with the option nolr;

prevalence - The prior/pre-test probability (between 0 and 1),

sensitivity - The diagnostic sensitivity of a the test (between 0 and 1),

specificity - The diagnostic specificity of a the test (between 0 and 1).

For each consequent triage, two to four more arguments are required in the following order lrp2+ lrn2+ lrp2- lrn2- where

lrp2+: - The likelihood ratio for positive results of the next test for the previous positives.

lrn2+: - The likelihood ratio for negative results of the next test for the previous positives.

lrp2-: - The likelihood ratio for positive results of the next test for the previous negatives.

lrn2-: - The likelihood ratio for negative results of the next test for the previous negatives.

With the option nolr, the conditional sensitivity and specificity for the positive and outcomes should be supplied i.e sensitivity2+ specificity2+ sensitivity2- specificity2-

Special values:

In lr mode, 1 indicates “no sequential test” on that branch (connecting arrow shown in grey) i.e.
when the next triage is done only on positive or negative outcomes. e.g. lrp2+ lrn2+ 1 1 or 1 1 lrp2- lrn2- respectively.

In nolr mode, 0.5 indicates “no sequential test” (connecting arrow shown in grey).

Missing values (.) hide the corresponding arrow completely. e.g. lrp2+ lrn2+ . .

Options

bands(numlist) A list specifying where the different bands appear. The numbers should be between 0 and 1.

bandcolor(string) Specifies the colour of the bands.

noLR Notifies the procedure to expect sensitivity and specificity as input instead of the LR+ and LR-.

dp(#) Decimal places for annotation labels (default: 2).

legendopts(str) Control legend display. legendopts(on) uses custom layout, legendopts(off) suppresses legend. Giving no options or legends(all) shows all the keys and their labels.

skip(#) Skip vertical spacing between triages and rows in the legend, useful for combining graphs with different numbers of tests.

options allow other two way graph options e.g xsize(3) ysize(7).

Examples

One test.

ppp 0.5 14.4 0.25, legendopts(on)
(click to run)

One test with enlarged axis titles.

ppp 0.5 14.4 0.25, bands(0.3 0.6) ytitle(,size(5) axis(1)) ytitle(,size(5) axis(2)) legendopts(on)
(click to run)

Two tests, second applied only to negatives

ppp 0.5 14.4 0.45 1 1 10 0.05, bands(0.3 0.6) legendopts(on)
(click to run)

Two tests, second applied only to positives

ppp 0.5 1.5 0.25 10 0.05 1 1 , bands(0.3 0.6) legendopts(on)
(click to run)

Two tests, hide the negative branch of the second test

ppp 0.5 1.5 0.25 10 0.05 . . , bands(0.3 0.6) legendopts(on)
(click to run)

Two tests, second applied only to positives, sensitivity and specificity as input.

ppp 0.5 0.9 0.6 0.9 0.6, bands(0.3 0.6) nolr legendopts(on)
(click to run)

Three tests with legend.

ppp 0.5 14.4 0.35 11 0.05 1 1 1 1 10 0.05 1 1, bands(0.3 0.6 ) bandcolor(blue*0.3 brown*0.3 red*0.3) legendopts(on)
(click to run)

Three tests without legend.

ppp 0.5 14.4 0.35 11 0.05 1 1 1 1 10 0.05 1 1, bands(0.3 0.6 ) bandcolor( green*0.3 orange*0.3 red*0.3) legendopts(off)
(click to run)

Author

Victoria N. Nyaga (Victoria.NyawiraNyaga@sciensano.be)

Belgian Cancer Center/Unit of Cancer Epidemiology,

Sciensano,

Juliette Wytsmanstraat 14,

B1050 Brussels,

Belgium.

Also see

Online: fagan (if installed)