Announcement

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

  • Correlation matrix in panel data model

    Hi Statalists,

    I am currently analysing panel data and, to give an overview of the data, I want to provide summary statistics and a correlation matrix. The correlation matrix is not used to decide whether to include or not include any varibales, I just want to give a brief overview of the direction and strenghts of the correlations.

    However, as I use panel data, I am not sure if this works the same way it does for regressions of time-series data.

    Can I still use

    Code:
    correlate varlist
    or

    Code:
    pwcorr varlist, star(0.01)
    to show the correlation or do I have to take into account special effects of panel data (e.g. do I have to group my data)? If yes, does STATA provide any commands in this respect?

    In case it is relevant, I am using a non-linear (poisson) regression model with state-year-fixed effects.

    All the best,
    Korhan

  • #2
    The correlation matrix is the normal correlation matrix, but it is not particularly informative, particularly if you're running a non-linear model. I suppose you could generate a set of data adjusted for fixed effects using xtdata, but I've never heard of doing this to generate a correlation matrix.

    Comment


    • #3
      Hi Phil,

      thanks for the hint! I did not now xtdata (and also found xtsum), which helped.

      Originally posted by Phil Bromiley View Post
      [...] particularly if you're running a non-linear model.
      Why wouldn't it make sense to check the covariates for correlation? My reasoning was: If correlation would be strong, I would have to think about whether I missed e.g. a confounding factor.

      Besides that, I am really wondering if the normal correlation matrix is sufficient here. After googling for hours it seems to me that nobody has ever posed this question and I wonder if I am completely missing something here.

      Would be happy for a further pointer.

      Comment


      • #4
        Korhan:
        a possible reason for the lack of post you complain about is that when correlation refers to panel data it may mean within, between or a mix of the two.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,

          thanks for your comment! I am not sure which option makes most sense here, but I suggest it is between or a mix of the both. What I am most interesting in showing with the correlation matrix is that my choice of covariates/independents is not flawed regarding my main regression, i.e. that there is no high correlation between any covariate.

          Comment


          • #6
            Korhan:
            what you're after relates more to choosing a model that gives a fair and true view of the data generating process underying your data: the lityerature in your research field can probably help you out in this respect than to investigating the -estat vce, corr- matrix.
            Besides, if collinearity is detected between your variables, they will be automatically omitted by Stata.
            As far as quasi-extreme multicollinearity is concerned, you may want to take a look at http://davegiles.blogspot.it/2011/09...umerosity.html, that warns about taking this nuisance too seriously (this approach was actually pioneered by Arthur Goldberg in his https://www.amazon.com/Course-Econom.../dp/0674175441), and observe the 95% CI of the coefficients of your regression, instead (see Clyde Schechter' s posts on this topic).
            Last edited by Carlo Lazzaro; 03 Mar 2018, 06:04.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hello everyone,

              I have received a review of a paper in which I developed a panel data analysis with fixed effects, and the reviewer has requested the following: "I believe it is necessary to include the correlation of the explanatory variables, as well as this correlation once it is controlled for time and city fixed effects."

              I can correctly operate the first correlation matrix. However, how can I create the second matrix that includes the fixed effects using STATA? I am struggling to incorporate the fixed effects into this matrix (in fact, I am not entirely sure if this even makes sense).

              I would greatly appreciate any kind of assistance, please. And I apologize if this is not the correct procedure for posting here.

              Comment


              • #8
                Dear community,

                I apologize if I insist, or if this is not the correct procedure, but is it possible if someone could help me, please? It would be very important for my research.

                Best regards,

                Comment


                • #9
                  Probably the referee is asking to see the correlations between the city-demeaned and time-demeaned variables, but I wonder how useful such correlations are. If you have a balanced panel, generating the variables is straightforward. However, if your panel is unbalanced, you will need to apply iterative demeaning. See https://www.statalist.org/forums/for...-time-variable.

                  Comment


                  • #10
                    Originally posted by Andrew Musau View Post
                    Probably the referee is asking to see the correlations between the city-demeaned and time-demeaned variables, but I wonder how useful such correlations are. If you have a balanced panel, generating the variables is straightforward. However, if your panel is unbalanced, you will need to apply iterative demeaning. See https://www.statalist.org/forums/for...-time-variable.
                    Thank you very much for your response, Andrew. My panel is balanced, how would I go about obtaining this then? Many thanks.

                    Comment


                    • #11
                      The linked thread shows you how to create the variables. What have you tried? What difficulties did you face?

                      Comment

                      Working...
                      X