Announcement

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

  • Compare correlation levels

    Hi,

    I am working with a panel data with two periods and would like to test the correlation levels between a set of variables, by year:

    correlate var1 var2 var3 if year==0
    correlate var1 var2 var3 if year==1

    I would like to know if there is a way to test if there is a statistical difference in correlation between variables by year (a t-test of correlation if you will).

    Thank you

  • #2
    You didn't get a quick reply. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    If you google "test equality of correlation coefficients stata" you'll find CORTESTI: Stata module to test equality of two correlation coefficients

    Comment


    • #3
      As far as I can tell, cortesti has methods for comparing two independent correlations (e.g., r_12 in two independent samples) and for comparing two non-independent correlations with one variable in common (e.g., r_12 vs r_13).

      Code:
      Test of equality of two correlation coefficients
      ------------------------------------------------
      
           cortesti #corr1 #n1 #corr2 #n2
           cortesti #rxy #rxv #rvy #n
      
      Description
      -----------
      
      --- snip ---
      In the first form, cortesti compares two coefficients computed from
      two different samples (n1 and n2 are the respective sizes of the samples).
      This test is only an approximation, and should only be used when both
      samples are larger than 10.
      
      In the second form, cortesti compares two coefficients i.e. r(x,y)
      and r(v,y) computed in a single sample using a third coefficient, r(x,v).
      The sample size is the fourth argument.
      But it sounds as if Nicolas wants to compare two non-independent correlations that have no variables in common: r_12 vs r_34. I am not aware of any Stata programs for that, but I do have some SPSS code for it (syntax file #7 on this page). I think it could be translated without too much difficulty. (If you prefer SAS code, see file #7 on this page on Karl Wuensch's website.)

      HTH.
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 18.5 (Windows)

      Comment

      Working...
      X