# Fitting the model
model <- lm(arr_delay ~ dep_delay + distance + month + day_of_week, data=my_flights)
summary(model)
Call:
lm(formula = arr_delay ~ dep_delay + distance + month + day_of_week,
data = my_flights)
Residuals:
Min 1Q Median 3Q Max
-107.713 -11.043 -1.974 8.699 205.871
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.585e+00 1.033e-01 -25.02 <2e-16 ***
dep_delay 1.018e+00 7.823e-04 1301.33 <2e-16 ***
distance -2.550e-03 4.259e-05 -59.86 <2e-16 ***
month 2.259e-02 9.183e-03 2.46 0.0139 *
day_of_week -1.980e-01 1.612e-02 -12.29 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 17.93 on 327341 degrees of freedom
Multiple R-squared: 0.8387, Adjusted R-squared: 0.8387
F-statistic: 4.255e+05 on 4 and 327341 DF, p-value: < 2.2e-16