Announcement

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

  • P value and 95%CI don't match

    Hello. I could like to calculate the risk difference between two groups for an outcome, using the
    Code:
    cs
    command.
    But I am confused by the output which shows P value is >0.05 whereas the 95% CI doesn't cover 0.

    Perhaps it is related to the low incidence of the outcome. But how are the P value and 95% CI calculated and why don't they match?

    Thank you very much!

    Below are the output

    . cs case exp [fw=pop]

    | exp |
    | Exposed Unexposed | Total
    -----------------+------------------------+------------
    Cases | 2 59 | 61
    Noncases | 1342 11717 | 13059
    -----------------+------------------------+------------
    Total | 1344 11776 | 13120
    | |
    Risk | .0014881 .0050102 | .0046494
    | |
    | Point estimate | [95% Conf. Interval]
    |------------------------+------------------------
    Risk difference | -.0035221 | -.0059456 -.0010986
    Risk ratio | .2970137 | .0726542 1.214206
    Prev. frac. ex. | .7029863 | -.2142064 .9273458
    Prev. frac. pop | .0720132 |
    +-------------------------------------------------
    chi2(1) = 3.23 Pr>chi2 = 0.0721


    . cs case exp [fw=pop], exact

    | exp |
    | Exposed Unexposed | Total
    -----------------+------------------------+------------
    Cases | 2 59 | 61
    Noncases | 1342 11717 | 13059
    -----------------+------------------------+------------
    Total | 1344 11776 | 13120
    | |
    Risk | .0014881 .0050102 | .0046494
    | |
    | Point estimate | [95% Conf. Interval]
    |------------------------+------------------------
    Risk difference | -.0035221 | -.0059456 -.0010986
    Risk ratio | .2970137 | .0726542 1.214206
    Prev. frac. ex. | .7029863 | -.2142064 .9273458
    Prev. frac. pop | .0720132 |
    +-------------------------------------------------
    1-sided Fisher's exact P = 0.0432
    2-sided Fisher's exact P = 0.0871

  • #2
    Please use code delimiters to present Stata output. In the results table produced by cs, you do not have p-values and 95% CIs presented together. Are you are confusing point estimates with p-values?

    Code:
    webuse csxmpl
    cs case exp [fw=pop]
    Res.:

    Code:
    . cs case exp [fw=pop]
    
                     | exp                    |
                     |   Exposed   Unexposed  |      Total
    -----------------+------------------------+------------
               Cases |         7          12  |         19
            Noncases |         9           2  |         11
    -----------------+------------------------+------------
               Total |        16          14  |         30
                     |                        |
                Risk |     .4375    .8571429  |   .6333333
                     |                        |
                     |      Point estimate    |    [95% Conf. Interval]
                     |------------------------+------------------------
     Risk difference |        -.4196429       |   -.7240828   -.1152029
          Risk ratio |         .5104167       |    .2814332    .9257086
     Prev. frac. ex. |         .4895833       |    .0742914    .7185668
     Prev. frac. pop |         .2611111       |
                     +-------------------------------------------------
                                   chi2(1) =     5.66  Pr>chi2 = 0.0173

    Comment


    • #3
      Thank you Andrew.
      Below are the codes:

      Code:
      csi 2 59 1342 11717
      and the output:
      Code:
      . csi 2 59 1342 11717
      
                       |   Exposed   Unexposed  |      Total
      -----------------+------------------------+------------
                 Cases |         2          59  |         61
              Noncases |      1342       11717  |      13059
      -----------------+------------------------+------------
                 Total |      1344       11776  |      13120
                       |                        |
                  Risk |  .0014881    .0050102  |   .0046494
                       |                        |
                       |      Point estimate    |    [95% Conf. Interval]
                       |------------------------+------------------------
       Risk difference |        -.0035221       |   -.0059456   -.0010986 
            Risk ratio |         .2970137       |    .0726542    1.214206 
       Prev. frac. ex. |         .7029863       |   -.2142064    .9273458 
       Prev. frac. pop |         .0720132       |
                       +-------------------------------------------------
                                     chi2(1) =     3.23  Pr>chi2 = 0.0721
      I am interested in the risk difference. The point estimate is -.0035221. The 95% CI for this estimate is (-.0059456, -.0010986) and does not cover 0, suggesting the risk difference is "statistically significant (P<0.05)". But the 'Pr>chi2 = 0.0721' tells me it isn't.
      Why are the 95% CI and the "Pr>chi2" inconsistent?

      Many thanks.

      PS. the inconsistency remains when I used the 'exact' option.
      Code:
      . csi 2 59 1342 11717,exact
      
                       |   Exposed   Unexposed  |      Total
      -----------------+------------------------+------------
                 Cases |         2          59  |         61
              Noncases |      1342       11717  |      13059
      -----------------+------------------------+------------
                 Total |      1344       11776  |      13120
                       |                        |
                  Risk |  .0014881    .0050102  |   .0046494
                       |                        |
                       |      Point estimate    |    [95% Conf. Interval]
                       |------------------------+------------------------
       Risk difference |        -.0035221       |   -.0059456   -.0010986 
            Risk ratio |         .2970137       |    .0726542    1.214206 
       Prev. frac. ex. |         .7029863       |   -.2142064    .9273458 
       Prev. frac. pop |         .0720132       |
                       +-------------------------------------------------
                                        1-sided Fisher's exact P = 0.0432
                                        2-sided Fisher's exact P = 0.0871

      Comment


      • #4
        This discrepancy is discussed in the full documentation of the epidemiological tabulation commands: follow the link at the top of the output of help cs to the full documentation in the Stata Base Reference Manual PDF included in your Stata installation and directly accessible from Stata's Help menu.

        In the PDF included in my installation of 16.1, the discussion is in the Technical Note that starts at the top of page 534 with "By default, cc and cci report exact confidence intervals but an approximate significance test." and it continues to an explanation of why the exact test and the confidence intervals disagree. This is one of the several sections of Example 10, which discusses the cci command, but it seems to me the logic is similar for the csi command.

        Comment


        • #5
          Thank you William. That's helpful. I have another question.
          The 95% CI of the Risk difference is (-.0059456 -.0010986) which does not contain 0, and the 95% CI of Risk ratio (.0726542, 1.214206) does cover 1. So they give different conclusions at significant level of P<0.05. The 95% CI of Risk ratio appears to agree with P value from the 2-sided Fisher's exact (P = 0.0871).

          Any idea?

          Comment


          • #6
            The discussion on page 533 covers the various possibilities for the confidence interval for the risk ratio.

            Comment

            Working...
            X