Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sensitivity and Specificit - Starter

    So Ive recently started using Stata. On previous forums I read how when calculating specificity and sensitivity, the correct syntax would be roctab GoldStandard NewTest... nevertheless according to the manual https://www.stata.com/manuals/rroctab.pdf roctab NewTest GoldStandard appears to be the correct syntax. When running diagtest, you can actually receive information on what Stata is getting True D as (NOT AVAILABLE WITH ROCTAB), and with that, diagtest NewTest GoldStandard is most definitely the correct syntax.

    I need some help on getting a definite answer about the correct syntax for roctab.

  • #2
    Im also having trouble as to why diagtest command uses 0 as true d rather 1 in binomial testing.

    diagtest diagtestA diagtestF if sospeingeaspi == 1
    (887 observations deleted)

    | diagtestF
    diagtestA | 0 1 | Total
    -----------+----------------------+----------
    0 | 49 53 | 102
    1 | 19 44 | 63
    -----------+----------------------+----------
    Total | 68 97 | 165

    True D defined as diagtestF ~= 0 [95% Conf. Inter.]
    -------------------------------------------------------------------------
    Sensitivity Pr( +| D) 45.36% 37.76% 52.96%
    Specificity Pr( -|~D) 72.06% 65.21% 78.91%
    Positive predictive value Pr( D| +) 69.84% 62.84% 76.84%
    Negative predictive value Pr(~D| -) 48.04% 40.42% 55.66%
    -------------------------------------------------------------------------
    Prevalence Pr(D) 58.79% 51.28% 66.30%
    -------------------------------------------------------------------------

    Comment


    • #3
      The PDF documentation is the definitive source of information for Stata commands. The syntax of -roctab- is given there as -roctab refvar classvar...-. refvar means the true diagnostic state, and classvar means the test result, as is explained in the second paragraph under the Description heading.

      As for diagtest, it is a user written command, so any question as to the design choices made by its author would have to be directed to that author. However, in this case, I think you are misreading things.
      True D defined as diagtestF ~= 0 [95% Conf. Inter.]
      (emphasis added)
      ~= is one of the two ways to say "does not equal" in Stata. (The other is !=.) So True D is defined as diagtestF is not 0.

      Comment


      • #4
        Thank you so much. This solves it.

        Comment

        Working...
        X