Documentos de Académico
Documentos de Profesional
Documentos de Cultura
5 - Regresión Lineal - Curvilínea
5 - Regresión Lineal - Curvilínea
Marcelo Rodrguez
Ingeniero Estadstico - Magster en Estadstica
Universidad Catlica del Maule
Facultad de Ciencias Bsicas
Pedagoga en Matemtica
Estadstica I
01 de enero de 2012
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
1 / 31
Introduccin
Comnmente, cuando se realiza un estudio estadstico, se miden a una
misma unidad de anlisis, ms de una variable.
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
2 / 31
covxy =
(xi x)(yi y)
i=1
n1
Sxy
n1
http://bit.ly/mrodriguez
01/01/2012
3 / 31
Promedio
Ingreso (xi )
15,6
14,8
15,5
12,5
14,2
15,7
12,3
14,2
8,8
11,9
13,55
Gasto (yi )
17,4
18,4
16,5
15,2
19,9
22,1
14,8
17,3
10,3
14,6
16,65
(xi x)
2,05
1,25
1,95
-1,05
0,65
2,15
-1,25
0,65
-4,75
-1,65
(yi y)
0,75
1,75
-0,15
-1,45
3,25
5,45
-1,85
0,65
-6,35
-2,05
Suma
(xi x)(xi x)
1,5375
2,1875
-0,2925
1,5225
2,1125
11,7175
2,3125
0,4225
30,1625
3,3825
55,065
http://bit.ly/mrodriguez
01/01/2012
4 / 31
Definicin (Correlacin)
El coeficiente de correlacin de Pearson, indica la fuerza y la direccin de
una relacin lineal entre dos variables aleatorias. Se considera que dos
variables cuantitativas estn correlacionadas cuando los valores de una de
ellas varan sistemticamente con respecto a los valores de la otra.
n
X
(xi x)(yi y)
Sxy
r=v
=p
uX
n
n
Sxx Syy
X
u
t (xi x)2
(yi y)2
i=1
i=1
mrodriguez@ucm.cl (UCM)
i=1
http://bit.ly/mrodriguez
01/01/2012
5 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
6 / 31
Ejemplo
Con los datos anteriores, calcule e interprete la correlacin.
Promedio
Ingreso (xi )
15,6
14,8
15,5
12,5
14,2
15,7
12,3
14,2
8,8
11,9
13,55
Gasto (yi )
17,4
18,4
16,5
15,2
19,9
22,1
14,8
17,3
10,3
14,6
16,65
Suma
(xi x)2
4,2025
1,5625
3,8025
1,1025
0,4225
4,6225
1,5625
0,4225
22,5625
2,7225
42,985
(yi y)2
0,5625
3,0625
0,0225
2,1025
10,5625
29,7025
3,4225
0,4225
40,3225
4,2025
94,385
55,065
La correlacin sera r = 42,98594,385
= 0, 865. Lo que indica es que el
Ingreso y Gasto estn relacionados, de forma directa casi perfecta (r
cercana a 1).
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
7 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
8 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
9 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
10 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
11 / 31
Gasto
18,0
16,0
14,0
12,0
10,0
8,00
10,00
12,00
14,00
16,00
Ingreso
http://bit.ly/mrodriguez
01/01/2012
12 / 31
y b0 = y b1 x
http://bit.ly/mrodriguez
01/01/2012
13 / 31
Ejemplo
Considerando los datos del problema anterior, encuentre la ecuacin de
regresin entre el Ingreso y el Gasto.
La ecuacin de prediccin esperada est dada por
yb = b0 + b1 x,
\ = b0 + b1 Ingreso,
Gasto
Donde, las estimaciones de los parmetros 1 y 0 son:
55, 065
= 1, 281;
b1 =
42, 985
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
14 / 31
Ejemplo
Entonces, la ecuacin sera:
\ = 0, 708 + 1, 281 Ingreso,
Gasto
Pendiente: Por cada unidad monetaria que se incrementa el Ingreso, el
gasto se incrementa en 1,281.
Intercepto: Un individuo con un ingreso muy pequeo (0), se estima
que su Gasto ser de -0,708. En este caso no tiene sentido.
Esta recta, puede servir para predecir, suponga que tiene un individuo con
un ingreso de 8, entonces se estima que su Gasto sera de
\ = 0, 708 + 1, 281 8 = 9, 54.
Gasto
Adems el porcentaje de la variabilidad total que explica el modelo es de
74,7% (r2 = 0, 8652 = 0, 747).
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
15 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
16 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
17 / 31
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
18 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial
b1
,001
,266
Por ejemplo, considere el problemaExponencial
donde se mide
el Ingreso=X
y el
La variable independiente esDAP.
Impuesto=Y.
Volumen
Ingreso=X
16,9
8,9
17,7
2,1
11,5
19,9
6,2
17,1
14,7
18,6
Impuestos=Y
,117
,025
,131
,001
,037
,198
,012
,127
,089
,167
0,200
0,150
0,100
0,050
0,000
0,0
5,0
10,0
15,0
20,0
DAP
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
19 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial
(Modelo exponencial)
El modelo exponencial, se puede solucionar mediante una regresin
lineal simple.
Aplicar el logaritmo natural a la ecuacin
yb = b0 exp[b1 x]
.
Tendramos
w = ln[b
y ] = ln[b0 ] + b1 x
.
Encuentre la ecuacin de regresin lineal simple entre X y W .
Luego se debe aplicar la exponencial a w para despejar yb.
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
20 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial
Ejemplo
Para los datos de Ingreso= X y Impuestos= Y, encuentre la ecuacin de
regresin yb = b0 exp[b1 x]. Considere lo siguiente:
Ingreso=X
16,9
8,9
17,7
2,1
11,5
19,9
6,2
17,1
14,7
18,6
Impuesto=Y
0,117
0,025
0,131
0,001
0,037
0,198
0,012
0,127
0,089
0,167
mrodriguez@ucm.cl (UCM)
W = ln[Y ]
-2,1456
-3,6889
-2,0326
-6,9078
-3,2968
-1,6195
-4,4228
-2,0636
-2,4191
-1,7898
http://bit.ly/mrodriguez
01/01/2012
21 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial
Ejemplo
Tambin podemos encontrar la ecuacin de regresin lineal simple
2 = 0, 890.
entre X e Y. La cual sera, yb = 0, 055 + 0, 011x, con rxy
2 = 0, 934.
El modelo exponencial es yb = 0, 001 exp[0, 266x], con rxw
En los datos existe un rbol con Ingreso= 14, 7 y Impuesto= 0, 089. Si
utilizamos estos dos modelos para predecir el impuesto de un
individuos con un ingreso de 14,7, tenemos
http://bit.ly/mrodriguez
01/01/2012
22 / 31
Regresin
Estimacin curvilnea: Algunos modelos clsicos
Modelo
Lineal
Logartmico
Ecuacin
yb = b0 + b1 x
yb = b0 + b1 ln[x]
Inverso
yb = b0 + b1
Cuadrtico
Cbico
Potencia
yb = b0 + b1 x + b2 x2
yb = b0 + b1 x + b2 x2 + b3 x3
1
x
c
yb = b0 x1
Compuesto
x
yb = b0 b1
G
1
yb = exp b0 + b1
x
Logstica
yb =
1
(0 + 1 2x )
Crecimiento
yb = exp[b0 + b1 x]
Exponencial
Comentario
Este modelo ya se analiz con todo detalle.
Calcule T = ln[X], encuentre la ecuacin de regresin lineal entre T e Y.
Luego, en la ecuacin yb = b0 + b1 t, reemplace t por ln[x].
yb = b0 exp[b1 x]
mrodriguez@ucm.cl (UCM)
Calcule T =
1
X,
1
x
y w = ln[b
y ].
01/01/2012
23 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial en SPSS
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
24 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial en SPSS
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
25 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial en SPSS
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
26 / 31
Regresin
Estimacin curvilnea: Modelo Exponencial en SPSS
Resumen del modelo y estimaciones de los parmetros
Variable dependiente:Impuestos
Resumen del modelo
Ecuacin
R cuadrado
gl1
Sig.
Constante
b1
Lineal
,890
64,951
,000
-,055
,011
Exponencial
,934
112,799
,000
,001
,266
Impuestos
Observado
Lineal
Exponencial
,200
,150
,100
,050
,000
,0
5,0
10,0
15,0
20,0
Ingreso
mrodriguez@ucm.cl (UCM)
http://bit.ly/mrodriguez
01/01/2012
27 / 31
ndice de sitio
28,0
26,0
24,0
22,0
20,0
,0
30
18,0
1,20
,0
1,25
35
1,30
1,35
Den
,0
40
1,40
sida
d
ON
NG LISTWISE
mrodriguez@ucm.cl
1,45
,0
45
1,50
(UCM)
,0
50
en
Ar
http://bit.ly/mrodriguez
01/01/2012
28 / 31
Asistencia (y)
4
5
6
7
8
7
8
10
Tamao (x1 )
2
2
4
4
5
5
6
6
Renta (x2 )
14
16
14
17
18
21
17
25
http://bit.ly/mrodriguez
01/01/2012
29 / 31
y1
y2
Y = . ,
..
yn
X= .
..
..
...
..
.
.
1 xn1 xn2 . . . xnk
0
1
= . ,
..
k
1
2
= . ,
..
n
http://bit.ly/mrodriguez
01/01/2012
30 / 31
Y=
4
5
..
.
X=
10
1 2 14
1 2 16
.. .. .. ,
. . .
1 6 25
0, 188
b = (XT X)1 XT Y = 0, 814 ,
0, 182
http://bit.ly/mrodriguez
01/01/2012
31 / 31