8.2 Baby weights, Part II.

Exercise 8.1 introduces a data set on birth weight of babies. Another variable we consider is parity, which is 0 if the child is the first born, and 1 otherwise. The summary table below shows the results of a linear regression model for predicting the average birth weight of babies, measured in ounces, from parity.

Estimate Std. Error t value Pr(>|t|) (Intercept) 120.07 0.60 199.94 0.0000 parity -1.93 1.19 -1.62 0.1052

  1. Write the equation of the regression line.

average birth weight = 120.07 -1.93*parity

  1. Interpret the slope in this context, and calculate the predicted birth weight of first borns and others.

When parity is 0 (first born), the average birth weight is 120.07 ounces. When parity is 1 (not first born), the average bith weight is 120.07 - 1.93 = 118.14 ounces.

120.07 - 1.93
## [1] 118.14
  1. Is there a statistically significant relationship between the average birth weight and parity?

No. It isn’t statistically significant at the 5% level.

8.4 Absenteeism, Part I.

Researchers interested in the relationship between absenteeism from school and certain demographic characteristics of children collected data from 146 randomly sampled students in rural New South Wales, Australia, in a particular school year. Below are three observations from this data set.

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).

Estimate Std. Error t value Pr(>|t|) (Intercept) 18.93 2.57 7.37 0.0000 eth -9.11 2.60 -3.51 0.0000 sex 3.10 2.64 1.18 0.2411 lrn 2.15 2.65 0.81 0.4177

  1. Write the equation of the regression line.

average number of days absent = 18.93 - eth(9.11) + 3.10(sex) + 2.15(lrn)

  1. Interpret each one of the slopes in this context.

When student is not aboriginal, average absent days is 9.11 less than 18.93 (statistically significant).

When student is male, average absent days is 3.10 more than 18.93.

When student is a slow learner, average absent days is 2.15 more than 18.93.

  1. Calculate the residual for the first observation in the data set: a student who is aboriginal, male, a slow learner, and missed 2 days of school.

Based on calculations below, the residual is -22.18 days.

eth <- 0
sex <- 1
lrn <- 1

predicted <- 18.93 - eth*9.11 + 3.10*sex + 2.15*lrn

2 - predicted
## [1] -22.18
  1. The variance of the residuals is 240.57, and the variance of the number of absent days for all students in the data set is 264.17. Calculate the R2 and the adjusted R2. Note that there are 146 observations in the data set.

R2 is 0.08933641. R2 adjusted is 0.07009704.

var_residual <- 240.57
var_outcome <- 264.17
n <- 146 
k <- 3

R2 <- 1 - (var_residual/var_outcome)
R2_adjusted <- 1 - (var_residual/var_outcome) * ((n-1)/(n-k-1))
R2
## [1] 0.08933641
R2_adjusted
## [1] 0.07009704