Rows: 9959 Columns: 2
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
dbl (2): Ingreso, Gasto_Educacion
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Call:
lm(formula = Gasto_Educacion ~ Ingreso)
Residuals:
Min 1Q Median 3Q Max
-8116.7 -1450.2 145.9 1553.0 10151.0
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.631e+03 7.150e+02 2.281 0.0247 *
Ingreso 1.093e-01 1.173e-02 9.319 3.64e-15 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3105 on 98 degrees of freedom
Multiple R-squared: 0.4698, Adjusted R-squared: 0.4644
F-statistic: 86.85 on 1 and 98 DF, p-value: 3.639e-15
Regresión
plot(x = datos$Ingreso,y = datos$Gasto_Educacion,xlab ="Ingreso",ylab ="Gasto en Educación",main ="Diagrama de Dispersión: Gasto en Educación")abline(modelo_naive, col ="red")
Diagnóstico con los residuos
plot(modelo_naive, 1,main ="Residuos vs Predichos")