Thank you very much,
My regards to all of you,
If you arrange your 2x2 table in the usual fashion (i.e., test result
in the rows, and gold standard in the columns), then sensitivity and
specificity are just column percentages in cells A and D; and PV+ and
PV- are row percentages for the same two cells. Here's an example.
* How to obtain Sens, Spec, PV+, and PV- for a screening test.
* Read in counts for a 2x2 table.
data list list / TestResult GoldStandard kount (3f5.0).
begin data
1 1 240
1 2 25
2 1 15
2 2 220
end data.
value labels
TestResult 1 'Positive' 2 'Negative' /
GoldStandard 1 'Has condition' 2 'Does NOT have condition'
.
weight by kount.
crosstabs TestResult by GoldStandard /
cells = count row col .
* SENS = % within GoldStandard in cell A .
* SPEC = % within GoldStandard in cell D .
* PV+ = % within TestResult in cell A .
* PV- = % within TestResult in cell D .
If you need the values for further processing, you can use the output
management system (OMS) to write the crosstabulation out to another
data set.
HTH.
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."