baby.b = 120.07 #intercept
baby.m = -1.93 # parity coefficient
paste0("y = ", round(baby.b, 2), " + ", round(baby.m, 2), " * x + ")## [1] "y = 120.07 + -1.93 * x + "
baby.x1 = 0
baby.x2 = 1
baby.y1 = baby.m * baby.x1 + baby.b
baby.y2 = baby.m * baby.x2 + baby.b
baby.y1## [1] 120.07
baby.y2## [1] 118.14
** On average, birth weight is 1.93oz lower for children born after the first. The predicted birth weight of first-born children is 120.07oz, and of non-first-born children is 118.14oz. **
** p-value is .1052, so there is not sufficient evidence to dismiss the null hypothesis at the 95% or 90% confidence levels.**
The summary table below shows the results of a linear regression model for predicting the average number of days absent based on ethnic background (eth: 0 - aboriginal, 1 - not aboriginal), sex (sex: 0 - female, 1 - male), and learner status (lrn: 0 - average learner, 1 - slow learner)
absent = 18.93 - 9.11 * eth + 3.10 * sex + 2.15 * lrn
The strongest predictor of absenteeism in this model is aboriginal ethnicity, followed by male sex, then slow learning status. Ceteris paribus, on average non-aboriginal studnets miss 9.11 fewer days; male students miss 3.10 more days; slow learners miss 2.15 more days.
eth = 0
sex = 1
lrn = 1
days = 2
absent = 18.93 - 9.11 * eth + 3.10 * sex + 2.15 * lrn
days - absent## [1] -22.18
The residual is -22.18 - the model overestimated number of days absent by 22 days.
baby.n <- 146
baby.k <- 3
baby.s.e <- 240.57
baby.s.y <- 264.17
baby.R2 <- 1 - (baby.s.e / baby.s.y)
baby.R2.adj <- 1 - (baby.s.e * (baby.n - 1)) / ((baby.s.y) * (baby.n - baby.k - 1))
paste0("R2 = ", round(baby.R2, 4), " and Adjusted R2 = ", round(baby.R2.adj, 4))## [1] "R2 = 0.0893 and Adjusted R2 = 0.0701"
We should remove learner status first. When it is not included in the model, the adjusted R^2 is .0723, which is higher than including all three predictors, removing sex, and removing ethnicity.