Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Difference between -spearman- and -pwcorr- with ranked variables


From   Owen Gallupe <[email protected]>
To   [email protected]
Subject   st: Difference between -spearman- and -pwcorr- with ranked variables
Date   Sun, 22 Sep 2013 23:26:56 -0400

Hi,

My understanding is that Spearman correlations are simply Pearson
correlations using ranked data. However, when I run the spearman
command I get different results from when I convert the variables to
ranks and then run the pwcorr command with the ranks.

. spearman var1 var2

rho = -0.0112, p = 0.5642


. egen rankvar1 = rank(var1)
. egen rankvar2 = rank(var2)

. pwcorr rankvar1 rankvar2, sig

r = -0.0100, p = 0.6058

I suspect it has something to do with the way I created the ranked
variables, but I'm not sure.

If someone could point me in the right direction, I would really appreciate it!

Owen
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index