Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: -senspec- interpretation question


From   Michael McCulloch <mm@pinest.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: -senspec- interpretation question
Date   Tue, 10 Nov 2009 13:51:10 -0800

Martin, this is an excellent explanation, thank you! And sorry for my  
misunderstanding of an elementary point!


On Nov 10, 2009, at 1:29 PM, Martin Weiss wrote:

>
> <>
>
>
> You should look at the column frequencies, i.e. condition on the  
> disease
> status, to get the correct picture. I also compare with official - 
> roctab-,
> and -senspec- gives the same answers:
>
>
> *************
> clear
> vers 9.2
> set obs 1000
> set seed 12358	
> gen byte test=irecode(uniform(),0,0.33,1)
> gen disease=_n>500
> tab test disease, row
> gen method=irecode(uniform(),0,0.5,1)
> bysort method: tab test disease, row
> tab test disease if method==1, /*row */  col
>
> senspec disease test if method==1, se(sens) spe(spec) fpos(fpos)  ///
> ntneg(ntneg) fneg(fneg) ntpos(ntpos) nfpos(nfpos) nfneg(nfneg)
> list test disease ntneg spec nfneg fneg nfpos fpos ntpos sens in 1/10
> //compare to official Stata
> roctab disease test if method==1, detail table
> *************
>
> If ever you are in doubt about the definitions of all these numbers,  
> look at
>
>
> *************
> webuse lbw, clear
> logit low age lwt i.race smoke ptl ht ui
> estat clas
> ************
>
> It is all defined in this last table...
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Michael
> McCulloch
> Gesendet: Dienstag, 10. November 2009 21:46
> An: Statalist Statalist
> Betreff: st: -senspec- interpretation question
>
> Dear Statalist folks,
> I'd like to ask advice on interpreting the output of -senspec-. I've
> created the following simple simulation example which allows me to
> compare the -senspec- output to a simple 2x2 table. The following code
> shows that the absolute numbers from -senspec- agrees with each cell
> of my 2x2 table, but the frequency values are different. Am I
> misinterpreting or mis-applying -senspec-?
>
> clear
> set obs 1000
> set seed 12358	
> gen test=1 + int(2*uniform())	
> replace test=0 if test==2
> replace test=1 in 1/300		
> gen disease=0 in 1/500
> replace disease=1 in 501/1000
> tab test disease, row
> gen method=1 + int(2*uniform())	
> bysort method: tab test disease, row
> tab test disease if method==1, row
> senspec disease test if method==1, se(sens) spe(spec) fpos(fpos)
> ntneg(ntneg) fneg(fneg) ntpos(ntpos) nfpos(nfpos) nfneg(nfneg)
> * cellA: ntneg sp  	cellB: nfneg fneg  	cellC: nfpos fpos
> cellD:
> ntpos se
> list test disease ntneg spec nfneg fneg nfpos fpos ntpos sens in 1/10
>
>
>
> Thank you kindly.
>
>
>
> Michael McCulloch
> Pine Street Foundation
> 124 Pine Street
> San Anselmo, CA 94960-2674
> tel:	415-407-1357
> fax: 	206-338-2391
> mm@pinestreetfoundation.org
>
>
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/



Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
mm@pinestreetfoundation.org









*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index