Dear Peter,

Many thanks for your reply.  Unfortunately I don't have access to the
reference book.

However it looks to me like the gold standard should be in the rows and the
comparison method should be in the columns for the test to give the right
answer (since the location of the gold standard determines which are true
and false positives, etc, which determines what the denominators of the
formulae are).

I tried swapping around the negatives and positives, but that doesn't make
much difference to the result (it is still the wrong way around):

> t1
         positive negative
positive      201        1
negative        0       18

> sensSpec(t1)

 Simple Sensitivity and Specitivity Output

Input Matrix:
         positive negative
positive      201        1
negative        0       18

The sample of sensitivity is: 100%

The sample of specificity is: 94.7%

Best,
Amy

On Tue, Feb 2, 2010 at 2:34 AM, Peter Dalgaard <p.dalgaard@biostat.ku.dk>wrote:

> Amy Mikhail wrote:
>
>> Dear R epidemiologists,
>>
>> The package help for the above function states:
>>
>> Arguments X A 2x2 matrix, with Gold Standard Class A and B in the columns
>> and Comparison Method A and B in the rows.
>> I understood this to mean the following:
>>
>>                                   Gold standard
>> Comparison method         A (neg)     B (pos)
>> A  (neg)                          18             1
>> B   (pos)                          0              201
>>
>> However, it gives the results backwards:
>>
>>  sensSpec(t1)
>>
>>  Simple Sensitivity and Specitivity Output
>>
>> Input Matrix:
>>          ref
>> r1a        negative positive
>>  negative       18        1
>>  positive        0      201
>>
>> The sample of sensitivity is: 100%
>>
>> The sample of specificity is: 99.5%
>>
>> but if you calculate the sensitivity and specificity by hand, sensitivity
>> is
>> 99.5 and specificity is 100%....
>>
>>
> That depends on the definition of negative and positive.
>
> The documentation is certainly unclear, but it seems likely that the
> intention is for the table to have positives in the first row and column.
> Have you consulted the reference given? (Notably, the example table.)
>
>
> --
>   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
>  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
>  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)              FAX: (+45) 35327907
>



-- 
Amy Mikhail
Program Manager, ACTc Afghanistan Malaria Project
London School of Hygiene & Tropical Medicine

****** NEW HPRO OFFICE ADDRESS
************************************************************************************************************************
HPRO Head Office, House number P860 (10th house on the right off Taimany
road), Street 10, Taimany, District 10, Kabul, Afghanistan
*********************************************************************************************************************************************************************

Email (Afg): amy.mikhail@googlemail.com
Email (UK): Amy.Mikhail@lshtm.ac.uk
Tel (Afg): +93 (0)706 126627
Tel (UK): +44 (0)781 4176107

	[[alternative HTML version deleted]]

