File Exchange

## Clinical Test Performance

version 1.15 (18.6 KB) by

The test calculate the performance of a clinical test based on the Bayes theorem

Updated

This function calculate the performance, based on Bayes theorem, of a clinical test.
Syntax: PARTEST(X,ALPHA)

Input:
X is the following 2x2 matrix.
ALPHA - significance level for confidence intervals (default = 0.05).
Outputs:
- Prevalence
- Sensibility and Specificity
- False positive and negative proportions
- False discovery and omission rates
- Youden's Index and Number Needed to Diagnose (NDD)
- Positive and Negative predictivity
- Positive and Negative Likelihood Ratio
- Predictive Summary Index (PSI) and Number Needed to Screen (NNS)
- Test Accuracy
- Mis-classification Rate
- F-Measure
- Test bias
- Error odds ratio
- Diagnostic odds ratio
- Discriminant Power

Moreover, the function draws two plots (as you can see in the screenshot)

Giuseppe Cardillo

### Giuseppe Cardillo (view profile)

this file is an open code: you can modify it as you want providing my aknowledgment

Hi.. can we used this code for multi class problem?

Giuseppe Cardillo

### Giuseppe Cardillo (view profile)

Noam, the message you get is from a previous version of roc.m routine and not from partest.m. When you have a test, using roc curve analysis you can choose a cut-off point (the point above/below which the test is positive) to obtain the max sensitivity or the max specificity or the max cost effective or the max efficiency or the max positive predictive value...and this choosing depends on your specific problem. Actually, I erased partest invoking from roc to simplify the code.

Anyway, Partest asks whether you want to input the true prevalence of a disease or not. Partest uses the Bayes'es Theorem and the true prevalence is needed to correctly apply it

Noam

### Noam (view profile)

Thanks for the code.

I looked at the source and didn't find an explanation for the "Choose cut-off to compute performance" message. What does it mean? and what values are relevant?

And one more question: I run partest within a loop and now I need to press enter every time the cut-off message appears. How can set it to run for the same value everytime it runs?

Shu

### Shu (view profile)

Giuseppe Cardillo

### Giuseppe Cardillo (view profile)

This is not very clear... Precisely what did you mean? If you open an m.file you always have a text version. To have the plots (did you mean plot when you wrote diagram?) you must run partest on MatLab

Dag Nyman

### Dag Nyman (view profile)

When tying to open the m file, only the textversion comes up. Not the useful diagram. Solution?

Giuseppe Cardillo

### Giuseppe Cardillo (view profile)

You are right, but fp1 and fp2 were swapped also into the routine. I have just uploaded a new version of partest. Thank you

Benjamin

### Benjamin (view profile)

Isn't 1-spec equal to false positive rate? I think this is backward on the output partest and roseplot figures (red should be false positive, and yellow should be false negative). In the code it seems like these values (fp1 and fp2) are used correctly throughout and just mis-labelled on the output graphs. Would you mind confirming this? As always, thanks for the excellent code. The comments in this one are really great and I learned a ton going through it.

Benjamin

Jan Simon

### Jan Simon (view profile)

Exhaustively commented, so you get not only the resulting numbers, but also the exact description of what they mean, if you read the source.

catalin001@k.ro mihai