Announcement

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

  • Panel Data Pearson Correlation Matrix

    Hello everyone,
    I would like to create a correlation matrix based on panel data.
    My time variable are months starting in 2004 and ending in 201.
    The id variable are companies of the Nasdaq-100.
    I would like to get a correlation matrix which contains different variables (like the monhtly returns, monthly trading volume or monthly search volume on Google) and the correlation between each of these variables.
    My problem is that I don't know which command I should use.
    I tried pwcorr but then I don't consider that I have panel data.

    Would be great if you could help me!
    Thanks!!

  • #2
    Hello, Liza,

    If you turn your model into - mixed - or - xtgee -, you may type - estat wcorrelation -

    According to the manual:

    estat wcorrelation displays the overall correlation matrix for a given
    cluster calculated on the basis of the design of the random effects and
    their assumed covariance and the correlation structure of the residuals.
    This allows for a comparison of different multilevel models in terms of
    the ultimate within-cluster correlation matrix that each model implies.
    Hopefully that helps,

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      Hello Marcos,
      Thanks for your prompt reply.
      I just tried your suggestion but unfortunately I didn't get what I wanted to have.
      I used :
      -xtgee return tradingvolume searchvolume, family(gaussian) link(identity) noconstant corr(exchangeable) vce(robust) scale(x2)-
      and after the -estat wcorrelation-
      Is there a mistake or what do I have to use instead?

      I'd like to get one correlation matrix (considerung all companies and months) which looks like this :

      Return Tradingvolume Searchvolume
      Return 1 value value
      Tradingvolume 1 value
      Searchvolume1 1

      I would really appreciate your help!
      Thanks

      Last edited by Liza Miller; 31 May 2015, 06:51. Reason: table was shown in a wrong way

      Comment


      • #4
        I have another suggestion:
        I tried to do a "normal" panel regression and afterwards I entered the command "estat vce, corr"
        Could this be a solution?

        Thanks for your help!!

        Comment


        • #5
          Hello Liza,


          There is a thread on the matter (http://www.statalist.org/forums/foru...ith-panel-data), and I hope that might be helpful to you.

          Best,

          Marcos
          Best regards,

          Marcos

          Comment

          Working...
          X