Solved

Confused about the difference between Correlation and Rsquared?

Posted on 2011-03-20
2
715 Views
Last Modified: 2013-11-13
Hi, I'm writing a stock analysis program and in it, I want to show if 2 stocks are related (ie. how much they move in synch). I'm already calculating the Correlation Coefficient between the 2 stocks and that seems to give a good realistic figure, and now I'm tackling Rsquared. I'm starting to wonder now if I even need to bother with Rsquared if I've already done the Correlation Coefficient. Isn't Rsquared just the Correlation Coefficient times itself? (if so, that info wouldn't be of much help). I'm using this formula to calculate Rsquared (as found doing a websearch):

Rsquared := Square (Covariance(Stock1,Stock2) / (StdDev(Stock1) * StdDev(Stock2)));

... but that formula does not yield the same value as the square of the Correlation Coefficient at all. Confused about that.

   Furthermore, in my googling, it seems to say that Rsquared is an indication of how good a LINEAR REGRESSION line "fits" the data. But in my program, I'm not really comparing one stock to a linear regression line, I'm comparing one stock to another stock, so I don't really seem how Rsquared would apply in this case. Anyway, as you can probably tell, I'm not a stats whiz and I'm a little confused... maybe I just don't need to be bothering with Rsquared at all,eh? Doesn't seem like it's gonna tell me anything more than Correlation Coefficient.

Thanks
    Shawn
0
Comment
Question by:shawn226
2 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 50 total points
ID: 35177790
Comparing how related two stocks are really is sort of a linear regression problem. It might not look like it, but you are looking at how well the first stock can predict the second stock. (If the are highly correlated, then you could use one to predict the other, so testing correlation is really mathematically the same as linear regression).

Yes, R square should be the square of the correlation coefficient. The correlation coefficient is often called R so R square is R^2.

The reason they aren't matching could be due to a few reasons.
1. You've miscalculated something
2. People use different definitions of the standard deviation. Often the "sample" standard deviation uses /(n-1) instead of /n to inflate the deviation slightly to adjust for the fact that you only have a sample. So if your calculations use different standard deviation methods, they won't match.
3. If R^2 is being defined as 1 - SSE/SST, then it might not match.

In short, they do measure the same thing. So you really could just pick one. If you want to go deeper in to it, you can post a sample and the two values your getting, and I'll help you sort out why. If you are fine just knowing that someone with a Math degree says you're right and you can use the correlation coeffitient to get R^2, then that's good too.
0
 

Author Closing Comment

by:shawn226
ID: 35192256
Righto Tommy, I'm just going to stick with Correlation Coefficient and not bother with Rsquared - as you say, it's just a derivative of Correlation Coefficient anyway, so it doesn't really supply anymore information than Correlation alone. I'm not gonna waste anymore time on it... thanks!

Cheers
   Shawn
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JAVA, generics, Iterator, LinkedLIst 2 435
Images for a Website that have different components 3 105
sameEnds challenge 25 83
object oriented javascript web form 8 104
This article explores the difference between two entities: List and Category.   In part one,  we'll look at the basic concepts, and set some groundwork.  In part two, we'll get to some conclusions. I know that these two things are different, but…
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now