Announcement

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

  • Need Help: 95% Confidence Interval not Equal to Estimate +/- 1.96 times of SE

    I need some help for the standard error and 95% confidence interval. My understanding is that the 95% confidence interval should be the estimate +/- (1.96 x Standard Error). However, when I ran the following codes, the reported 95% confidence interval is quite different (see attachment regression results). Can anyone help explain why Stata gave me such results? Thank you very much.

    Code:
    clear
    input float prod_x byte(year month)
    5.2 1 1
    5.4 1 2
    6.3 2 1
    6.5 2 2
    end
     
    
    regress prod_x i.year
    Example.pdf

  • #2
    Moon:
    please note that, as per FAQ, attachment are discouraged on this forum.
    Use CODE delimiters instead thanks.
    That said, please note that the 95% CIs in OLS are calculated according to the t distribution, that takes degrees of freedom into account.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Elaborating on Carlo's explanation, the difference is because you have very few degrees of freedom, so the critical t-value which is used by Stata is very different from 1.96.

      Here is the calculation:

      Code:
      . regress prod_x i.year
      
            Source |       SS           df       MS      Number of obs   =         4
      -------------+----------------------------------   F(1, 2)         =     60.50
             Model |  1.21000031         1  1.21000031   Prob > F        =    0.0161
          Residual |  .040000019         2   .02000001   R-squared       =    0.9680
      -------------+----------------------------------   Adj R-squared   =    0.9520
             Total |  1.25000033         3  .416666778   Root MSE        =    .14142
      
      ------------------------------------------------------------------------------
            prod_x |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
            2.year |        1.1   .1414214     7.78   0.016      .491513    1.708487
             _cons |        5.3         .1    53.00   0.000     4.869735    5.730265
      ------------------------------------------------------------------------------
      
      . dis "Lower bound of 95% CI = " _b[2.year] - invttail(2,.025)*_se[2.year]
      Lower bound of 95% CI = .49151301
      
      . dis "Uper bound of 95% CI = " _b[2.year] + invttail(2,.025)*_se[2.year]
      Uper bound of 95% CI = 1.7084873
      and the critical value is not 1.96, but rather

      Code:
      . dis invttail(2,.025)
      4.3026527

      Comment


      • #4
        Thank you both for the explanation.

        Comment

        Working...
        X