Correlation Tables -- Setup

  • Thread starter Thread starter Zeelotes
  • Start date Start date
Z

Zeelotes

I'm trying to Pearson Ranks correlation table. This is the formula I'm
using:

=PEARSON(Ranks!$B$3:$B$230,Ranks!B$3:B$230)

This is placed in cell B3. When I copy the formula over to DT3 the formula
correctly adjusts the B in the second part of the formula all the way to DT
and still references the values in the B column.

But I want to now copy this down to C4, D5, E6 and then over to DT for each
so that it correctly makes the correlation table.

What is the best way to do this?

Thanks for any help you can provide.
 
I'm trying to Pearson Ranks correlation table. This is the formula I'm
using:

=PEARSON(Ranks!$B$3:$B$230,Ranks!B$3:B$230)

This is placed in cell B3. When I copy the formula over to DT3 the formula
correctly adjusts the B in the second part of the formula all the way to DT
and still references the values in the B column.

But I want to now copy this down to C4, D5, E6 and then over to DT for each
so that it correctly makes the correlation table.

What is the best way to do this?

Thanks for any help you can provide.

Just take out the $ sign before the row numbers.

Rgds



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
Just take out the $ sign before the row numbers.

Rgds

------------------------------

Doing this will cause the results to not match the succeeding columns. Let
me illustrate:

C4 must be: =PEARSON(Ranks!$C$3:$C$230,Ranks!C$3:C$230)

D5 must be: =PEARSON(Ranks!$D$3:$D$230,Ranks!D$3:D$230)

E6 must be: =PEARSON(Ranks!$E$3:$B$230,Ranks!E$3:B$230)

In other words, each successive row must be fixed in the first part to the
next column over.

I'm guessing you have to use COLUMN or INDEX or OFFSET or some similar
function which I am not familiar with.

Thanks for the offer of help.
 
Perhaps one way ..
Try in B3:
=PEARSON(OFFSET(Ranks!$A$3:$A$10,,ROWS($A$1:A1)),Ranks!B$3:B$10)
Copy B3 across to DT3, fill down
 
Some corrections & refinements to the earlier post ..

Put instead in B3:
=PEARSON(OFFSET(Ranks!$A$3:$A$230,,ROWS($A$1:A1)),
Ranks!B$3:B$230)

(corrections made for cell refs)

With B3 selected,
Click Format > Conditional Formatting (CF)
Under condition 1, make the settings as:
Formula is: =ROWS($A$1:A1)>COLUMNS($A$1:A1)
Click Format button > Font tab > Font Color white > OK
Click OK at the main dialog

Copy B3 across to DT3, fill down

The CF will make the diagonal half below "invisible"
(assuming the fill color is the default: no color)

If you don't want the diagonal 1's to appear as well,
just change the CF formula in the starting cell B3 to:
=ROWS($A$1:A1)>=COLUMNS($A$1:A1)
and copy across/fill down as before
 
Thanks a million. That works perfectly. Now I just need to work on
understanding it so that I can use it again. -:)
 
Just take out the $ sign before the row numbers.

Rgds

------------------------------

Doing this will cause the results to not match the succeeding columns. Let
me illustrate:

C4 must be: =PEARSON(Ranks!$C$3:$C$230,Ranks!C$3:C$230)

D5 must be: =PEARSON(Ranks!$D$3:$D$230,Ranks!D$3:D$230)

E6 must be: =PEARSON(Ranks!$E$3:$B$230,Ranks!E$3:B$230)

In other words, each successive row must be fixed in the first part to the
next column over.

I'm guessing you have to use COLUMN or INDEX or OFFSET or some similar
function which I am not familiar with.

Thanks for the offer of help.


Slightly puzzled. Is there a typo above? You indicate C4 references
column C in both parts, D5 references column D in both parts, but E6
references both columns E & B in both parts. This doesn't seem
consistent.

The solution to your query no doubt lies with the INDIRECT function
but I'm not yet quite understanding your query.

Secondary question, doesn't the Rank correlation require two different
data sets, one dependent on the other? If so why are both sets the
same in your example?

Rgds



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
Slightly puzzled. Is there a typo above? -- Yes, a typo to the right of E6.

The solution to your query no doubt lies with the INDIRECT function
but I'm not yet quite understanding your query. -- I'm sure willing to
learn how if you can explain. Max's solution works perfectly, but if there
is another way I'm sure I'll learn even more from this.

Secondary question, doesn't the Rank correlation require two different
data sets, one dependent on the other? If so why are both sets the
same in your example? -- the result of the formula I give is 100% or just
one depending on the formatting. But as the formula is copied over to the
right, the values will reflect the Spearman rank for each of the distinct
trading strategies being compared to the one that is locked. Make sense?
 
Slightly puzzled. Is there a typo above? -- Yes, a typo to the right of E6.

With =PEARSON(Ranks!C$3:C$230,Ranks!C$3:C$230) in C3, this will copy
to say E6 as =PEARSON(Ranks!E$3:E$230,Ranks!E$3:E$230), which appears
to satisfy your original query - or am I still missing something?

Rgds



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
With =PEARSON(Ranks!C$3:C$230,Ranks!C$3:C$230) in C3, this will copy
to say E6 as =PEARSON(Ranks!E$3:E$230,Ranks!E$3:E$230), which appears
to satisfy your original query - or am I still missing something?

Let me illustrate with an example:

D3 should be: =PEARSON(Ranks!$C$3:$C$230,Ranks!D$3:D$230)

But per your suggested formula it would be:
=PEARSON(Ranks!D$3:D$230,Ranks!D$3:D$230)

As a result, all of the results will always reference itself and result in a
result of 100%.
 
It appears that you already have a solution, so my contribution is
simply to point out that if you are using an Excel version prior to
2003, then you should be using CORREL() instead of PEARSON().

CORREL() and PEARSON() are mathematically equivalent, but in versions
prior to 2003, PEARSON() uses a numerically inferior algorithm.

Jerry
 
Be aware of the following:
1. PEARSON() do not calculate correctly in Excel 2000.
-> Use CORREL()

In versions of that are Excel earlier than Excel 2003, PEARSON may
exhibit round-off errors. The behavior of PEARSON has been improved in
Excel 2003. CORREL has always been implemented with the improved
procedure that is now used in Excel 2003. Therefore, if you are using
PEARSON for a version of Excel that is earlier than Excel 2003,
Microsoft recommends that you use CORREL instead."
http://support.microsoft.com/default.aspx?kbid=828129&product=xl2003
(Why do microsoft implement two different version of the same
function?)

"In versions of Excel that are earlier than Excel 2003, PEARSON may
exhibit round-off errors. This behavior leads to round-off errors in
RSQ"
http://support.microsoft.com/default.aspx?kbid=828131&product=xl2003



2. RANK()
-> If you have tieded ranks you need to use a formula like (rank data
in B6:B17)

=RANK($B6,$B$6:$B$17,1) + 0.5*(COUNTIF($B$6:$B$17,"=" & $B6)-1)

or this by microsoft

=RANK(B6,$B$6:$B$17,1) + (COUNT($B$6:$B$17) + 1 -
RANK($B6,$B$6:$B$17,0) - RANK($B6,$B$6:$B$17,1))/2

Excel Statistical Functions: Representing Ties by Using RANK
http://support.microsoft.com/default.aspx?kbid=828678&product=xl2003


Regards
Nikolai
http://www.pvv.org/~nsaa/excel.html
 
Back
Top