You are on page 1of 5

Anlisis de Datos I

Esquema del Tema 10

Tema 10. Relacin Lineal


1. RELACIN LINEAL
2. CUANTIFICACIN DE LA RELACIN LINEAL
La Covarianza
La Correlacin de Pearson
Matriz de Varianzas-Covarianzas, S
Matriz de Correlaciones, R
3. EJEMPLO

__________________
Bibliografa: Tema 8 (pg. 143-170)
Ejercicios recomendados del libro: 1, 2, 3, 4, 5, 6, 7, 8, 9 y 10.

Carmen Ximnez

Anlisis de Datos I

Esquema del Tema 10

1. LA RELACIN LINEAL
TIPOS DE RELACIN LINEAL

3
6

1
3

2
5

3
7

1
4

Directa
o positiva

8
7
6

X:
Y:

5
4
3
2
,5

1,0

1,5

2,0

2,5

3,0

3,5

2
4

4
2

6
1

2
3

1
5

Inversa
o negativa

6
5
4

S:
T:

3
2
1
0
0

2
5

4
4

4
7

2
4

2
8

9
8

Nula

U:
W:

6
5
4
3
0

2. CUANTIFICACIN DE LA RELACIN LINEAL


La Covarianza
Sxy =

X Y - (XY)
i i

- Sxy +

S xy =

Otras frmulas:

x y
i

S xy = rxy S x S y

La Correlacin de Pearson

rxy =

(n X Y ) ( X Y )
n X ( X ) nY (Y )

i i

Otras frmulas:

2
i

rxy =

z
n

zy

-1 rxy 1

rxy =

Sxy
SxSy

En transformaciones lineales la covarianza se altera pero la correlacin de Pearson no:


Si: U = a X + b ; V = c Y + d

SUV = (a) (c) SXY


ruv = rxy (Si a y c tienen signo opuesto: ruv = -rxy )

Carmen Ximnez

Anlisis de Datos I

Esquema del Tema 10

Matriz de Correlaciones, R

Matriz de Varianzas-Covarianzas, S
X
S x2

X
S = Y
M
Z

Y
S xy
S y2

L
L
L
O

Z
S xz
S yz
M
S z2

Medias: X

X
R = Y
M
Z

Y
r xy
1

L
L
L
O

Z
r xz
r yz
M
1

Sxy

Para pasar de S a R puede aplicarse la frmula

rxy =

En los ejemplos anteriores:


Xi
Yi
3
6
1
3
2
5
3
7
1
4
Totales:
10
25
Medias:
2
5

Xi Yi
18
3
10
21
4
56
11,2

Xi 2
9
1
4
9
1
24

Yi 2
36
9
25
49
16
135

SxSy

Totales:
Medias:

Si
2
4
6
2
1
15
3

Ti
4
2
1
3
5
15
3

Si Ti
8
8
6
6
5
33
6,6

Si2
4
16
36
4
1
61

Ti 2
16
4
1
9
25
55

Totales:
Medias:

Ui
2
4
4
2
2
14
2,8

Wi
5
4
7
4
8
28
5,6

Ui Wi
10
16
28
8
16
78
15,6

Ui2
4
16
16
4
4
44

Wi2
25
16
49
16
64
170

S xy =

X
1

X Y - (X Y ) = 11,2 - 10 = 1,2
i

S st =

S T - (ST ) = 6,6 - 9 = 2,4

S uw =

U W - (U W ) = 15,6 - 15,68 = 0,08

Carmen Ximnez

Anlisis de Datos I

ruw =

( X Y )
( X ) n Y ( Y )

n X i Yi

rxy =

rst =

Esquema del Tema 10

n X2
i

( S T )
n S ( S ) n T ( T )

(U W )
n U ( U ) n W ( W )

n S i Ti

2
i

2
i

2
i

2
i

n U i Wi

2
i

5(56 ) (10 )( 25)

( 5(24) (10) )( 5(135) (25) )

X
Y
S= S
T
U
W
Medias:

= 0,95

( 5(61) (15) )( 5(55) (15) )


2

5(78) (14)(28)

( 5(44) (14) )( 5(170) (28) )


2

= 0,05

Matriz de Correlaciones, R

S
0 , 20
0 ,60

T
0
0 , 20

U
0, 40
0,80

W
0,60
0,60

X
Y

3, 20

2 , 40
2

1,60
1, 20
0,96

0
0,60
0 ,08
2,64

R= S
T
U
W

2,8

= 0,95

5(33) (15 )(15 )

Matriz de Varianzas-Covarianzas, S
X
Y
0 ,80 1, 20
2

X
1,00

Y
0,95
1,00

S
0,12
0, 24

T
0,00
0,10

U
0, 46
0,58

W
0, 41
0, 26

1,00

0,95
1,00

0,91
0,87
1,00

0,00
0 , 26
0,05
1,00

5,6

3. EJEMPLO (resuelto):
X:
Y:

2
3

3
3

5
5

1
2

4
2

a) Calcule la Covarianza, la Correlacin de Pearson y el diagrama de dispersin para las


variables X e Y
b) Calcule la Correlacin de Pearson y la Covarianza para las variables T y W, siendo
T = 2 X + 3; W = 3 Y
Solucin:

a)

X:
Y:
XY:
X2 :
Y2 :

2
3
6
4
9

3
3
9
9
9

5
5
25
25
25

1
2
2
1
4

4
2
8
16
4

15
15
50
55
51

S xy =

X Y - (XY) = 50 (3)(3) = 1

6
5

4
3

rxy =

2
1
0
0

b) rtw = rxy = 0,645

i i

( X Y )
n X ( X ) n Y ( Y )

n Xi Yi
2
i

2
i

(5)(50 ) (15 )(15 )


(5)(55 ) (15 ) 2

)(

(5)(51) (15 ) 2

) = 0,645

Stw = (2) (3) Sxy = (6) (1) = 6

(Pues T y W son transformaciones lineales de X e Y)

Carmen Ximnez

Anlisis de Datos I

Esquema del Tema 10

EJERCICIOS
1. Obtenga el diagrama de dispersin, la covarianza y la correlacin de Pearson para X

e Y en los siguientes ejemplos:


(a)

Xi
4
3
3
2
5
6

(b)

Yi
15
12
10
9
14
13

Xi
7
10
11
9
8
3

Yi
6
10
11
11
8
12

(c)

Xi
10
8
10
6
7

Yi
4
7
5
7
6

2. A partir de la siguiente matriz de varianzas-covarianzas, realice el volcado a la

matriz de correlaciones:

V
X
Y

S=

3.

12

10
15

14
9
20

Tras medir las variables X e Y en una muestra


X: Estrs laboral
Y: Intencin de abandono del puesto
Se obtienen los siguientes estadsticos:
X
Y

S=

X
33,65

Y
54,8
101,76

Medias:
11,5
48,8
1. Existe relacin entre X e Y? Interprtela.
2. Si se obtienen las variables: U = 2 X + 3 y

V = -3 Y

Obtenga la media y varianza de U y V y la covarianza y correlacin de Pearson entre U y V

CI

4.
CI
RE
R = RA
ML
DE
LC

(1)
(2)
(3)
(4)
(5)
(6)

RE
0,82

RA
0,61

ML
0,42

DE
0,23

LC
0,32

0,40

0,15
0,76

0,03
- 0,06

0,08
- 0,23

0,15

- 0,41
0,23

CI: Cociente de inteligencia


RE: Razonamiento espacial
RA: Rendimiento acadmico
ML: Motivacin de logro
DE: Debilidad emocional
LC: Locus de control externo
CI: Cociente de inteligencia

Qu variable correlaciona ms con RA?


Qu variable correlaciona menos con ML?
Cul es la mayor correlacin encontrada?
Cul es la menor correlacin encontrada?
RA se relaciona ms con CI o con ML?
Qu significa la correlacin negativa entre ML y LC?

Carmen Ximnez

You might also like