Announcement

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

  • Multiple linear regression analysis: How to get Confidence Interval with beta coefficients?

    Hello!
    As the title states, I'm wondering how to calculate CI with the beta option applied in multiple linear regression analysis?

    Have a great day!

    Kind regards
    Lars Andersson

  • #2
    And while you are at it, you can ask "How do you get the standard errors?". Specifying the option -beta- just displays the standardized coefficients and these are not stored. If you want the complete output, just do the standardization yourself.

    Code:
    sysuse auto, clear
    regress mpg weight turn disp gear, beta
    *STANDARDIZE
     foreach var of varlist mpg weight turn disp gear{
        qui sum `var' if e(sample)
        replace `var'= (`var'- r(mean))/r(sd) if e(sample)
    }
    regress mpg weight turn disp gear
    Res.:

    Code:
    . regress mpg weight turn disp gear, beta
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(4, 69)        =     32.97
           Model |  1604.11887         4  401.029717   Prob > F        =    0.0000
        Residual |  839.340592        69  12.1643564   R-squared       =    0.6565
    -------------+----------------------------------   Adj R-squared   =    0.6366
           Total |  2443.45946        73  33.4720474   Root MSE        =    3.4877
    
    ------------------------------------------------------------------------------
             mpg |      Coef.   Std. Err.      t    P>|t|                     Beta
    -------------+----------------------------------------------------------------
          weight |  -.0059168    .001442    -4.10   0.000                -.7948307
            turn |  -.1345925   .1808358    -0.74   0.459                -.1023455
    displacement |   .0077091   .0116152     0.66   0.509                 .1223716
      gear_ratio |   .5694417   1.606361     0.35   0.724                 .0449103
           _cons |   41.26146   8.248975     5.00   0.000                        .
    ------------------------------------------------------------------------------
    
    
    
    . regress mpg weight turn disp gear
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(4, 69)        =     32.97
           Model |  47.9241331         4  11.9810333   Prob > F        =    0.0000
        Residual |  25.0758665        69  .363418355   R-squared       =    0.6565
    -------------+----------------------------------   Adj R-squared   =    0.6366
           Total |  72.9999996        73  .999999994   Root MSE        =    .60284
    
    ------------------------------------------------------------------------------
             mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          weight |  -.7948307   .1937067    -4.10   0.000    -1.181265   -.4083964
            turn |  -.1023455   .1375093    -0.74   0.459    -.3766691    .1719781
    displacement |   .1223716   .1843761     0.66   0.509    -.2454486    .4901917
      gear_ratio |   .0449103   .1266894     0.35   0.724    -.2078281    .2976487
           _cons |  -7.97e-09   .0700789    -0.00   1.000    -.1398037    .1398037
    ------------------------------------------------------------------------------
    Last edited by Andrew Musau; 07 Dec 2022, 05:14.

    Comment


    • #3
      Great! Thank you Andrew!

      Kind regards
      Lars

      Comment

      Working...
      X