Está en la página 1de 3

CODIGO R

Intentos <- c(1,2,3,4,5,6,7,8,9,10)

Errores <- c(15,12,10,8,7,5,5,3,1,1)

plot(Intentos,Errores,main="Modelo de Regresión Cuadrático")

lmPolXY <- lm(Errores ~ I(Intentos) + I(Intentos^2))

summary(lmPolXY)

x <- Intentos

curve(lmPolXY$coefficient[1] + lmPolXY$coefficient[2]*x + lmPolXY$coefficient[3]*x^2, add=T,

col="red")
Call:
lm(formula = Errores ~ I(Intentos) + I(Intentos^2))

Residuals:
Min 1Q Median 3Q Max
-0.75152 -0.31288 -0.09394 0.23258 1.06364
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.83333 0.71009 23.706 6.04e-08 ***
I(Intentos) -2.42576 0.29656 -8.180 7.91e-05 ***
I(Intentos^2) 0.08333 0.02627 3.172 0.0157 *
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.6037 on 7 degrees of freedom


Multiple R-squared: 0.9869, Adjusted R-squared: 0.9831
F-statistic: 262.8 on 2 and 7 DF, p-value: 2.604e-07

ECUACIÓN DE REGRESIÓN

Y= 16.83333 -2.42576x + 0.08333x2


Intersecto = 16.8333
A medida que va realizando más intentos disminuye los errores.
Pendiente= -2.48576x

Coeficiente de variación
0.9869

NUMERO PROMEDIO DE ERRORES / 5 TEST

Y(5)= 16.83333 -2.42576(5) + 0.08333(52)

y(5)= 6.78778

También podría gustarte