Announcement

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

  • Panel Data & Pearson's Correlation Matrix

    Hi,

    I am using log variable. Should I use the logged variable for my Pearson's matrix or regular variable? I have used both and saw the result varies. Which one is correct?

    Thank you
    Jenifar
    (Stata 16.1 SE)

  • #2
    Jenifar:
    I'm not clear with what you're asking here.
    Temptative reply: if you mean the variance and covariance matrix displaying correlation, please see the following toy-example:
    Code:
    . use "https://www.stata-press.com/data/r16/nlswork.dta"
    . xtreg ln_wage c.age##c.age, vce(cluster idcode)
    
    Random-effects GLS regression                   Number of obs     =     28,510
    Group variable: idcode                          Number of groups  =      4,710
    
    R-sq:                                           Obs per group:
         within  = 0.1087                                         min =          1
         between = 0.1015                                         avg =        6.1
         overall = 0.0870                                         max =         15
    
                                                    Wald chi2(2)      =    1258.33
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
                                 (Std. Err. adjusted for 4,710 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             age |   .0590339   .0041049    14.38   0.000     .0509884    .0670795
                 |
     c.age#c.age |  -.0006758   .0000688    -9.83   0.000    -.0008107    -.000541
                 |
           _cons |   .5479714   .0587198     9.33   0.000     .4328826    .6630601
    -------------+----------------------------------------------------------------
         sigma_u |   .3654049
         sigma_e |  .30245467
             rho |  .59342665   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . estat vce, corr
    
    Correlation matrix of coefficients of xtreg model
    
                 |              c.age#         
            e(V) |      age     c.age     _cons
    -------------+------------------------------
             age |   1.0000                    
     c.age#c.age |  -0.9907    1.0000          
           _cons |  -0.9890    0.9641    1.0000
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X