You are on page 1of 3

Correlation coefficient

Peter Wester


Consider n datapoints , , . ) , (
1 1
y x ) , (
n n
y x
The average of the values is defined as (1) and the variance as (2):
i
x

=
=
n
i
i
x
n
x
1
1
(1)

(
(

|
.
|

\
|

=

= = =
2
1 1
2
1
2 2
1
1
1
) (
1
1
n
i
i
n
i
i
n
i
i x
x
n
x
n
x x
n
s (2)

For the values we can define the average and the variance in the same manner as
(3) and (4).
i
y

=
=
n
i
i
y
n
y
1
1
(3)

(
(

|
.
|

\
|

=

= = =
2
1 1
2
1
2 2
1
1
1
) (
1
1
n
i
i
n
i
i
n
i
i y
y
n
y
n
y y
n
s (4)

The covariance for the ( values is defined as (5). ) ,
i i
y x

(

=

= =
y x n y x
n
y y x x
n
s
n
i
i i
n
i
i i xy
1 1
1
1
) )( (
1
1
(5)


The correlation coefficient is defined as (6):

(
(

|
.
|

\
|

(
(

|
.
|

\
|

=


= =


= = = =
= = =
= =
=
2
1
2
1
2
2
1 1
2
1 1 1
1
2
1
2
1
1 1
1
) ( ) (
) )( (
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i i
n
i
i
n
i
i
n
i
i i
y x
xy
y
n
y x
n
x
y x
n
y x
y y x x
y y x x
s s
s
r
(6)


This formula for the correlation coefficient can be found when substituting the
formulas for , and into
xy
s
x
s
y
s r .
When using weightfactors, (6) can be rewritten as (7):
Correlation coefficient
=


=


= =
=
n
i
i i
n
i
i i
n
i
i i i
y y w x x w
y y x x w
r
1
2
1
2
1
) ( ) (
) )( (



(
(
(
(

|
.
|

\
|

(
(
(
(

|
.
|

\
|

=
=
= =
=
=
= =
=
=
2
1
1
1
2
2
1
1
1
2
1 1
1
1
1 1
1
n
i
i i
n
i
i
n
i
i i
n
i
i i
n
i
i
n
i
i i
n
i
i i
n
i
i i
n
i
i
n
i
i i i
y w
w
y w x w
w
x w
y w x w
w
y x w
(7)


with

=
=
=
n
i
i
n
i
i i
w
x w
x
1
1
and

=
=
=
n
i
i
n
i
i i
w
y w
y
1
1
. (8)

For calculating correlation coefficients, regard the data points as .
represents the measured values and Y as predicted values (calculated using the
calibration curve).
) , (
i i
Y y
i
y
i

When using weightfactors inverse to concentration
i
i
x
w
1
= in formula (7) and (8).
When using weightfactors inverse to square of concentration
2
1
i
i
x
w = in formula
(7) and (8).

In the Asterix software is also the possibility to use weightfactors inverse- and
squared inversed to the response (is
i
i
y
w
1
= and
2
1
i
i
y
w = respectively).


Version CC.01.01 (030401 pW)
-2-
Correlation coefficient
-3-
Appendix A: derivation (7)

( ) ( )

= =
+ =
n
i
i i
n
i
i
x x x x x x
1
2 2
1
2
2


= = =
+ =
n
i
n
i
i
n
i
i
x x x x
1
2
1 1
2
2


= = = = =
+ =
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
x x
nn
n
x x
n
x
1 1 1 1 1
2
2


2
1 1
2
1
|
.
|

\
|
=

= =
n
i
i
n
i
i
x
n
x


(

=

n
i
i
y y
1
2
) , analog to ( )

=

n
i
i
x x
1
2


( )( ) ( )

= =
+ =
n
i
i i i i
n
i
i i
y x x y y x y x y y x x
1 1


y x n y x x y y x
n
i
n
i
i
n
i
i i i
+ =

= = = 1 1 1



= = = = = = =
+ =
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i i
y x
nn
n
y x
n
x y
n
y x
1 1 1 1 1 1 1
1 1



= = =
=
n
i
i
n
i
i
n
i
i i
y x
n
y x
1 1 1
1

You might also like