Announcement

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

  • correlation matrix for dependent variables in panel data

    hello ,

    i am looking for a command to generate correlation matrix of the variables in the panel data. i run fixed effect regression . as per my dissertation supervisor, i should report correlation matrix.

    please help

    sultan

  • #2
    You should ask your dissertation supervisor to clarify his or her instructions. With panel data, there are within-panel correlations and across-panel correlations: they are different. Which is wanted? Perhaps both. I have seen a situation where people have reported both by putting the across-panel correlations above the diagonal and the within-panel correlations below as a compact display of both.

    In any case, appropriate applications of -xtdata- and -corr- would generate these numbers. See -help xtdata-.

    Comment


    • #3
      thanks clyde

      i am new to stata and to empirical work. i had no experience and i am running out of time. thus may you please provide me the full commands cause i am not familiar with the shortcuts in your reply for booth within-panel correlations and across-panel correlations. apologies for this.


      i am looking for an option to pool the data in the panel and then generate the correlation matrix. by pooling i mean averaging the variables values for each observation. so instead of having multiple observations for each individual there will be one for each. not sure if this is the correct meaning of pooling.


      regards
      sultan

      Comment


      • #4
        So, here's an example of how it's done:

        Code:
        webuse nlswork, clear
        
        preserve
        //    BETWEEN CORRELATIONS
        xtdata ln_wage wks_work hours tenure, be
        corr ln_wage wks_work hours tenure
        restore
        
        //    WITHIN CORRELATIONS
        xtdata ln_wage wks_work hours tenure, fe
        corr ln_wage wks_work hours tenure
        Again, you need to ask your supervisor whether it is the within or the between correlations (or both) that are wanted.

        The calculation of group means is a form of pooling (though not what is typically meant by the term), and it is, in fact, what the -xtdata, be- command does.

        Comment


        • #5
          thanks clyde

          i have applied that .

          Comment


          • #6
            hello clyde

            i am now looking for a way to generate the correlation matrix with stars on significant correlation. similar to what "estimate table , star " gives back . if there is a way please help .

            thanks

            Comment


            • #7
              Consider using -pwcorr- instead of -corr- in the codes above, with the -star()- and -listwise- options. See -help pwcorr-.

              By the way, although it is easy to fall into the trap of thinking of these threads as a dialog between a person asking a question and another person responding, it is not really that. There are others who follow along on these threads, and some of them might be better positioned to answer a question than the person who responded first to your thread. So it is better not to address follow-up questions to any one in particular: you might discourage somebody else who could give you a better answer or respond sooner.

              Comment

              Working...
              X