Problem 1a
View(marathon)
is.data.frame(data)
## [1] FALSE
lm(time ~ age, data = marathon)
##
## Call:
## lm(formula = time ~ age, data = marathon)
##
## Coefficients:
## (Intercept) age
## 127.987 2.636
summary(model)
##
## Call:
## lm(formula = time ~ age, data = marathon)
##
## Residuals:
## Min 1Q Median 3Q Max
## -64.078 -23.078 -1.896 23.195 53.376
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 127.9873 19.3001 6.631 5.48e-08 ***
## age 2.6364 0.3677 7.170 9.50e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 29.92 on 41 degrees of freedom
## Multiple R-squared: 0.5563, Adjusted R-squared: 0.5455
## F-statistic: 51.41 on 1 and 41 DF, p-value: 9.501e-09
anova(model)
## Analysis of Variance Table
##
## Response: time
## Df Sum Sq Mean Sq F value Pr(>F)
## age 1 46026 46026 51.406 9.501e-09 ***
## Residuals 41 36709 895
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Problem 1l
mean(marathon$age)
## [1] 51
sd(marathon$age)
## [1] 12.55654