Thanks Martin, -roctab- doesn't seem suitable for this purpose because
my simulated test is only binary, without cut-points.
However, I have tested -senspec-, and am puzzled by the output. 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-?
Michael
***
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)
* A ntneg sp B nfneg fneg C nfpos fpos D ntpos se
list test disease ntneg spec nfneg fneg nfpos fpos ntpos sens in 1/10
***
On Nov 10, 2009, at 12:22 AM, Martin Weiss wrote:
>
> <>
>
> Have you had a look at -roctab- and friends? Also see -ssc d
> senspec- by
> Roger Newson...
>
>
>
> HTH
> Martin
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Michael
> McCulloch
> Gesendet: Dienstag, 10. November 2009 07:04
> An: Statalist Statalist
> Betreff: st: graphing sensitivity and specificity for a binary test
> outcome
>
> Dear Statalist members,
>
> With the following code I simulate diagnostic data and, in the last
> line, estimate specificity (cell A in the 2x2 table) and sensitivity
> (cell D).
> What I'm hoping to learn is how to create a bar graph that would
> display the specificity and sensitivity percentages for both methods 1
> and 2.
>
> ***
> 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
> list in 1/20
> tab test disease, row
> gen device=1 + int(2*uniform())
> bysort device: tab test disease, row
> ***
>
>
>
>
> Michael McCulloch
> Pine Street Foundation
> 124 Pine Street
> San Anselmo, CA 94960-2674
> tel: 415-407-1357
> fax: 206-338-2391
> [email protected]
>
>
>
>
>
>
> *
> * 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
[email protected]
*
* 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/