model <- lm(lap_time ~ speed + tire_wear, data = f1)
summary(model)
##
## Call:
## lm(formula = lap_time ~ speed + tire_wear, data = f1)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.7228 -1.2246 -0.0721 1.2609 4.4005
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 126.420910 3.350140 37.74 <2e-16 ***
## speed -0.184921 0.015145 -12.21 <2e-16 ***
## tire_wear 0.054358 0.004705 11.55 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.714 on 157 degrees of freedom
## Multiple R-squared: 0.6569, Adjusted R-squared: 0.6525
## F-statistic: 150.3 on 2 and 157 DF, p-value: < 2.2e-16
On a real team, you’d add more predictors (track temp, fuel load, traffic, etc.).