Holooly Plus Logo

Question 11.2: A psychologist speculates that spending a lot of time on the......

A psychologist speculates that spending a lot of time on the internet has a negative effect on children’s sleep. Consider the following data on hours of deep sleep (Y) and hours spent on the internet (X) where x_{i} and y_{i} are the observations on internet time and deep sleep time of the ith (i = 1, 2, . . . , 9) child respectively:

(a) Estimate the linear regression model for the given data and interpret the coefficients.
(b) Calculate R² to judge the goodness of fit of the model.
(c) Reproduce the results of a) and b) in R and plot the regression line.
(d) Now assume that we only distinguish between spending more than 1 hour on the internet (X = 1) and spending less than (or equal to) one hour on the internet (X = 0). Estimate the linear model again and compare the results. How can \hat{\beta } now be interpreted? Describe how \hat{\beta } changes if those who spend more than one hour on the internet are coded as 0 and the others as 1.

Child i 1 2 3 4 5 6 7 8 9
Internet time x_{i} (in h) 0.3 2.2 0.5 0.7 1.0 1.8 3.0 0.2 2.3
Sleep time y_{i} (in h) 5.8 4.4 6.5 5.8 5.6 5.0 4.8 6.0 6.1
Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

(a) To estimate \hat{\beta } , we use the second equality from (11.6):

\left.\begin{matrix} \hat{\beta }=\frac{S_{xy}}{S_{xx}}=\frac{\sum{\left(x_{i}-\bar{x} \right) \left(y_{i}-\bar{y} \right)} }{\sum{\left(x_{i}-\bar{x} \right)^{2}} }=\frac{\Sigma ^{n}_{i=1}x_{i}y_{i}-n\bar{x}\bar{y}}{\Sigma ^{n}_{i=1}x_{i}^{2}-n\bar{x}^{2}} \\ \hat{\alpha }=\bar{y}-\hat{b}\bar{x} \end{matrix} \right\},  (11.6)

\hat{\beta } =\frac{\Sigma ^{n}_{i=1} x_{i}y_{i}-n\bar{x}\bar{y} }{\Sigma ^{n}_{i=1} x^{2}_{i}-n\bar{x}^{2}} .

Calculating \bar{x}= 1.333, \bar{y}= 5.556, \Sigma ^{n}_{i=1} x_{i}y_{i}= 62.96, \Sigma ^{n}_{i=1} x^{2}_{i}= 24.24, and  \Sigma ^{n}_{i=1} y^{2}_{i}= 281.5 leads to

\hat{\beta } = \frac{62.91 − 9 · 1.333 · 5.556}{24.24 − 9 · 1.333^{2}} \approx \frac{−3.695}{8.248} \approx −0.45,

\hat{\alpha }= \bar{y} – \hat{\beta } \bar{x}= 5.556 + 0.45 · 1.333 \approx 6.16,

\hat{y }_{i}= 6.16 − 0.45 x_{i} .

For children who spend no time on the internet at all, this model predicts 6.16 h of deep sleep. Each hour spent on the internet decreases the time in deep sleep by 0.45 h which is 27 min.

(b) Using the results from (a) and S_{yy} =\Sigma ^{n}_{i=1} y^{2}_{i}-n\bar{y}^{2} \approx 3.678 yields:

R^{2}=r^{2}= \frac{S^{2}_{xy}}{S_{xx}S_{yy}}= \frac{\left(−3.695\right)^{2} }{8.248 · 3.678} \approx 0.45.

About 45 % of the variation can be explained by the model. The fit of the model to the data is neither very good nor very bad.

(c) After collecting the data in two vectors (c()), printing a summary of the linear model (summary(lm())) reproduces the results. A scatter plot can be produced by plotting the two vectors against each other (plot()). The regression line can be added with abline():

it <- c(0.3,2.2,…,2.3)
sleep <- c(5.8,4.4,…,6.1)
summary(lm(sleep∼it))
plot(it,sleep)
abline(a=6.16,b=-0.45)

The plot is displayed in Fig. B.20.

(d) Treating X as a binary variable yields the following values: 0, 1, 0, 0, 0, 1, 1, 0, 1. We therefore have \bar{x} = 0.444, \Sigma x^{2}_{i} = 4, and \Sigma x_{i}y_{i}= 4.4 + 5.0 + 4.8 + 6.1 = 20.3. Since the Y -values stay the same we calculate

\hat{\beta } =\frac{\Sigma ^{n}_{i=1} x_{i}y_{i}-n\bar{x}\bar{y} }{\Sigma ^{n}_{i=1} x^{2}_{i}-n\bar{x}^{2}}= \frac{20.3 − 9 · 5.556 · 0.444}{4 − 9 · 0.444^{2}} \approx −0.85 .

Thus, those children who are on the internet for a long time (i.e. >1 h) sleep on average 0.85 h (=51 min) less. If we change the coding of 1’s and 0’s, \hat{\beta } will just have a different sign: \hat{\beta } = 0.85. In this case, we can conclude that children who spend less time on the internet sleep on average 0.85 h longer than children who spend more time on the internet. This is the same conclusion and highlights that the choice of coding does not affect the interpretation of the results.

1

Related Answered Questions

Question: 11.3

Verified Answer:

(a) The correlation coefficient is r=\frac...