Announcement

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

  • 95% Confidence Interval (LR+ / LR-)

    Dear Stata community,


    I am currently working on Stata 18 version, and I can't find the way to calculate the 95% conf. interval of the LR+ and LR -



    Code:
    diagtest Test Outcome
    (8,050 observations deleted)
    
               |        Outcome
      Test     |         0          1 |     Total
    -----------+----------------------+----------
             0 |       385         42 |       427
             1 |        86         35 |       121
    -----------+----------------------+----------
         Total |       471         77 |       548
    
    True D defined as mort ~= 0                           [95% Conf. Inter.]
    -------------------------------------------------------------------------
    Sensitivity                     Pr( +| D)  45.45%      41.29%   49.62%
    Specificity                     Pr( -|~D)  81.74%      78.51%   84.98%
    Positive predictive value       Pr( D| +)  28.93%      25.13%   32.72%
    Negative predictive value       Pr(~D| -)  90.16%      87.67%   92.66%
    -------------------------------------------------------------------------
    Prevalence                      Pr(D)      14.05%      11.14%   16.96%
    -------------------------------------------------------------------------
    
    . roctab  Outcome Test  
    
    Detailed report of sensitivity and specificity
    ------------------------------------------------------------------------------
                                               Correctly
    Cutpoint      Sensitivity   Specificity   classified          LR+          LR-
    ------------------------------------------------------------------------------
    ( >= 0 )          100.00%         0.00%       14.05%       1.0000    
    ( >= 1 )           45.45%        81.74%       76.64%       2.4894       0.6673
    ( >  1 )            0.00%       100.00%       85.95%                    1.0000
    ------------------------------------------------------------------------------
    
    
                          ROC                     Asymptotic normal  
               Obs       area     Std. err.      [95% conf. interval]
         ------------------------------------------------------------
               548     0.6360       0.0299        0.57734     0.69461

    Does someone knows how to perform the 95% conf. interval of the LR+ and LR - on Stata?



    Thanks in advance
    Last edited by Carolina Hincapie; 08 Mar 2024, 10:05.

  • #2
    Hello Carolina Hincapie. Like risk ratios, your positive and negative likelihood ratios are ratios of two independent proportions. Therefore, I would use the MOVER-R method Robert Newcombe describes for risk ratios in this article. I don't know if anyone has written Stata code for this method. Perhaps someone else knows.
    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 18.5 (Windows)

    Comment


    • #3
      You could also use bootstrapping to generate CIs, if this makes sense from a statistical point of view.
      Best wishes

      (Stata 16.1 MP)

      Comment


      • #4
        Thanks for the answers.


        Some one recommended this webs sites for the 95% CI:

        MedCalc's Diagnostic test evaluation calculator

        Epidat 3.1 (English) - Consellería de Sanidade - Servizo Galego de Saúde (sergas.es)

        In both they give me the same 95% CI between them, but different than the ones given by Stata (Post #1):

        Click image for larger version

Name:	Screenshot 2024-03-11 120813.png
Views:	1
Size:	100.0 KB
ID:	1746199










        Not sure if I should concern about this.
        Last edited by Carolina Hincapie; 11 Mar 2024, 06:20.

        Comment


        • #5
          You can try the user contributed command diagt from net sj 4-4 sbe36_2
          http://fmwww.bc.edu/RePEc/bocode/d/diagt.hlp

          Code:
           diagt truth test 
          
          Truth.   |
                     |      Test
                     |      Pos.       Neg. |     Total
          -----------+----------------------+----------
            Abnormal |        17          6 |        23 
              Normal |         4         54 |        58 
          -----------+----------------------+----------
               Total |        21         60 |        81 
          True abnormal diagnosis defined as truth = 1 
          
          
                                                            [95% Confidence Interval]
          ---------------------------------------------------------------------------
          Prevalence                         Pr(A)       28%       19%      39.5%
          ---------------------------------------------------------------------------
          Sensitivity                      Pr(+|A)     73.9%     51.6%     89.8%
          Specificity                      Pr(-|N)     93.1%     83.3%     98.1%
          ROC area               (Sens. + Spec.)/2      .835      .738      .933 
          ---------------------------------------------------------------------------
          Likelihood ratio (+)     Pr(+|A)/Pr(+|N)      10.7      4.04      28.4 
          Likelihood ratio (-)     Pr(-|A)/Pr(-|N)       .28       .14      .559 
          Odds ratio                   LR(+)/LR(-)      38.3      9.94       147 
          Positive predictive value        Pr(A|+)       81%     58.1%     94.6% 
          Negative predictive value        Pr(N|-)       90%     79.5%     96.2% 
          ---------------------------------------------------------------------------
          Stata 15.1 (MP 2 core)
          https://www.epidemiology.tech/category/stata/
          Google Scholar Profile

          Comment

          Working...
          X