Documente Academic
Documente Profesional
Documente Cultură
Modelos de Regresión
PROFESOR: BACHILLER:
Estatura(x) 186 189 190 192 193 193 198 201 203 205
Peso(y) 85 85 86 90 87 91 93 103 100 101
CALCULO DE LOS PARÁMETROS DE LOS MODELOS.
Modelo Lineal:
Coeficientes:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -107.139 24.578 -4.359 0.00242
I(x) 1.022 0.126 8.110 3.96e-05
y= -107.139+1.022x
Modelo Cuadrático.
Coeficientes:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 354.33544 1006.40186 0.352 0.735
I(x) -3.69487 10.28363 -0.359 0.730
I(x^2) 0.01204 0.02625 0.459 0.660
y=354.33544-3.69487x+0.01204x^2
Modelo Cubico.
Estadísticos básicos de los Residuos:
Coeficientes:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.570e+04 3.337e+04 1.370 0.220
I(x) -7.015e+02 5.133e+02 -1.366 0.221
I(x^2) 3.589e+00 2.631e+00 1.364 0.222
I(x^3) -6.109e-03 4.494e-03 -1.359 0.223
Y=45698.64-701.4606x+3.589153x^2-0.006109265x^3
Modelo Exponencial.
Estadísticos básicos de los Residuos:
Coeficientes:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.382660 0.256490 9.289 1.47e-05
I(x) 0.010963 0.001315 8.339 3.24e-05
Y=10.83368exp (0.010963x)
Modelo Potencial.
Estadísticos básicos de los Residuos:
Coeficientes:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -6.7861 1.3651 - 4.971 0.00109
I(log(x)) 2.1444 0.2589 8.283 3.4e-05
Y=0.001129365x^ (2.1444)
COMPARACIÓN DE MODELOS.
MODELO FORMULA 𝑹𝟐
Lineal y= -107.139+1.022x 0.878
Cuadrático y=354.33544-3.69487x+0.01204x^2 0.864
Cubico Y=45698.64-701.4606x+3.589153x^2-0.006109265x^3 0.879
Exponencial Y=10.83368exp (0.010963x) 0.883
Potencial Y=0.001129365x^ (2.1444) 0.882
De los tres modelos resulta mejor para este problema es el exponencial ya que
se obtuvo un coeficiente de bondad de ajuste R^2 mayor en comparación con los otros
modelos, lo cual se puede observar en la gráfica conjunta
SCRIPTS QUE SE USARON PARA RESOLVER LA TAREA.
x=c(186,189,190,192,193,193,198,201,203,205)
y=c(85,85,86,90,87,91,93,103,100,101)
plot(x,y,pch=21,col="red",xlab="Estatura",ylab="Peso", main="Modelo de regresion
Lineal"
reg1=lm(y~I(x))
reg2=lm(y~I(x)+I(x^2))
reg3=lm(y~I(x)+I(x^2)+I(x^3))
reg4=lm(log(y)~I(x))
reg5=lm(log(y) ~ I(log(x)))
summary(reg1)
summary(reg2)
summary(reg3)
summary(reg4)
summary(reg5)
g1=function(x)-107.139+1.022x
g2=function(x) 354.33544-3.69487x+0.01204x^2
g3=function(x)Y=45698.64-701.4606x+3.589153x^2-0.006109265x^3
g4=function(x) 10.83368exp (0.010963x)
g5=function(x) 0.001129365x^ (2.1444)
curve(g1,from=0.00,to=2100.00,add=TRUE,col="red")
curve(g2,from=0.00,to=210.00,add=TRUE,col="blue")
curve(g3,from=0.00,to=210.00,add=TRUE,col="green")
curve(g4,from=0.00,to=210.00,add=TRUE,col="yellow")
curve(g5,from=50.00,to=210.00,add=TRUE,col="purple")