Starting from:
$30

$24

Week 3 homework problems solution

    1. Do problem 2.1. Complete 2.1.1, 2.1.2, and only do the first two sentences of 2.1.3.

There are plenty of ways to get SXX, SYY, SXY from R. One way involves the scale() function, which centers a vector of data and, if you want, also divides the vector by its standard deviation. Since we only want to center the data, we will use the argument scale=FALSE:

centered.X <- scale(Htwt$wt,scale=FALSE) SXX <- sum(centered.X^2)



    2. For the data set in problem 2.1, do the following.

        (a) Write out the simple linear regression model, including the mean function and the variance function.

        (b) Interpret the intercept and slope estimates you obtained above.

        (c) What does it mean when we call the fitted model the “best”? (In other words, what is the idea behind OLS?)
        (d) What does it mean to say that the OLS estimators are “linear”?

        (e) Using the fitted model, predict the weight of a person from this population who is 171.0 cm tall.



    3. For the data set brains in the alr4 library, do the following.

        (a) Fit the simple linear regression model using log(BrainWt) as the response and log(BodyWt) as the predictor. Report the estimated slope and residual standard error of the fitted model.
        (b) What do you know about the point defined by the mean of log(BodyWt) and the mean of log(BrainWt), relating to the fitted model?

        (c) If the errors are normally distributed in the population, what are the distributions of the slope estimator and the error variance estimator?
        (d) What is the fitted value for Raccoons? What is its residual?

        (e) If a new animal species was sampled, which had a log(BodyWt) of 1.46 (just like Raccoons), would the variance of its prediction error match the variance of the fitted value for Raccoons? Why or why not?

More products