Announcement

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

  • How to test the difference between two Spearman correlations

    Dear members,

    I hope you are all doing well.

    I have two simple questions:



    Question 1:

    Code:
    . spearman u30 u40
    
    Number of obs = 5001
    Spearman's rho = -0.1995
    
    Test of Ho: u30 and u40 are independent
    Prob > t = 0.0000
    
    . spearman u31 u41
    
    Number of obs = 5803
    Spearman's rho = -0.2359
    
    Test of Ho: u31 and u41 are independent
    Prob > t = 0.0000
    Now I want to test if these two correlations are significantly different. That is, -0.1995 is significantly different from -0.2359.



    Question 2:

    How to compare two R-square from two regressions using Vuong test.



    Thank you very much for your suggestions.

    Mustafa
    Last edited by Mostafa Harakeh; 15 Jun 2015, 20:44.

  • #2
    Dear Mustafa,

    regarding the first question, I think one could use a bootstrap procedure. The following procedure bootstraps the difference between both correlations. As output, you get the bootstrapped difference and the 95% confidence interval.

    However, I'm not sure if this is the best way to compare two Spearman correlations, so any suggestions are welcome.

    All the best

    Matthias


    capture prog drop spearmandiff
    program define spearmandiff, rclass
    spearman var1 var2
    local def1=`r(rho)'
    spearman var1 var3
    local def2=`r(rho)'
    return scalar diff = `def1' - `def2'
    end
    bootstrap diff=r(diff), reps(1000) saving(spearmandiff_bsreps, replace every(1)): spearmandiff

    Comment


    • #3
      Dear Matthias,

      Thank you very much for providing the bootstrapping code.

      I hope this works.

      Best wishes,
      Mustafa

      Comment

      Working...
      X