# Regresión lineal simple
modelo <- lm(avg_price_milk ~ dairy_ration, data = datos)
modelo |> summary()
Call:
lm(formula = avg_price_milk ~ dairy_ration, data = datos)
Residuals:
Min 1Q Median 3Q Max
-0.033635 -0.008394 -0.002785 0.003106 0.055094
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.086176 0.007885 10.930 1.67e-12 ***
dairy_ration 1.038172 0.127443 8.146 2.10e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.01655 on 33 degrees of freedom
Multiple R-squared: 0.6679, Adjusted R-squared: 0.6578
F-statistic: 66.36 on 1 and 33 DF, p-value: 2.102e-09