Announcement

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

  • e(Sigma)

    Hello
    I am running a VAR and getting covariance matrix of the errors instead of correlation matrix using matlist e(Sigma)

    matlist e(Sigma)

    | pkay pbko pnior pseg psan psik
    -------------+---------------------------------------------------------------------------------------------------
    pkay | 154.6524
    pbko | 43.54131 111.5155
    pnior | 50.91939 52.6377 290.7672
    pseg | 48.8736 79.47023 58.04128 151.4966
    psan | 24.52065 61.51676 27.54746 86.41532 138.0055



  • #2
    That is not an error. e(Sigma) is the covariance matrix of the errors.

    Comment


    • #3
      Thanks. Yes I agree but I want to get rather the correlation type of the standard errors for a better interpretation of the linear correlation.

      Comment


      • #4
        Does anyone have an idea of how to convert the Cov-matrix into the Correlation matrix?

        Comment


        • #5
          Code:
          matrix A = (1,1,8.1 \ 1,16,18 \ 8.1,18,81 )
          mata st_matrix("D",sqrt(diagonal(st_matrix("A"))))
          matrix D = diag(D)
          matrix Di = inv(D)
          matrix R = Di * A * Di
          matrix list R
          Taken from:
          HTML Code:
          https://blogs.sas.com/content/iml/2010/12/10/converting-between-correlation-and-covariance-matrices.html#:~:text=You%20can%20use%20similar%20operations,reciprocals%20of%20the%20standard%20deviations.

          Comment


          • #6
            Thanks George. I just used a simple command "Correlate" with the appropriate varlist and it seems to work.

            Comment

            Working...
            X