[Solved] MAST30025 Lab 6

$25

File Name: MAST30025_Lab_6.zip
File Size: 141.3 KB

SKU: [Solved] MAST30025 Lab 6 Category: Tag:
5/5 - (1 vote)

Questions 17 use the sleep dataset, which you can download from the course website. This dataset contains (among other things) data on the body weight (kg) and brain weight (g) of 62 mammals. Use the following commands to read the data:

> mammals <- read.csv(../data/sleep.csv)

> mammals$BodyWt <- log(mammals$BodyWt)

> mammals$BrainWt <- log(mammals$BrainWt)

This creates a data frame, mammals, with components (among others) named BodyWt and BrainWt, then applies a logarithmic transformation to both BodyWt and BrainWt.

  1. Fit a linear model explaining brain weight from body weight, using the lm

Display the summary of the fitted model, and then create a scatter plot of the data and superimpose the fitted regression line on it. Does it look like a reasonable fit?

Use diagnostic plots to assess if the model assumptions are satisfied.

  1. Using the fitted model or otherwise, obtain:
    • The least squares estimator of the parameters, b;
    • The vector of residuals, e;
    • The residual sum of squares, SSRes;
    • The regression sum of squares, SSReg;
    • The estimator for the variance of the errors, s2;
    • The standardised residuals;
    • The leverages of the points;
    • The Cooks distances of the points;
    • 95% confidence intervals for each of the parameters.
  2. Find a 95% confidence interval for a mammal weighing 50 kg.
  3. Find a 95% prediction interval for a mammal weighing 50 kg.
  4. Find and draw a 95% joint confidence region for the parameters.
  5. Test the following hypotheses, using the anova
    • H0 : = 0
    • H0 : 1 = 0
    • H0 : 0 = 0
    • H0 : = (2,1)
  6. By visualising the raw data, justify the use of a double logarithmic transformation. Write downthe final model for the (untransformed) brain weight vs. body weight.
  7. In this question we consider the hypothesis H0 : = . The test statistic for this hypothesis is

.

1

  • Show that

(b)TXTX(b) = (y X)T(y X) (y Xb)T(y Xb).

That is, it is the SSRes for the null model minus the SSRes for the full model. Also show that

(b)TXTX(b) 6= yTX(XTX)1XTyXTX.

That is, in this case we can not write it as the SSReg for the full model minus the SSReg for the model under H0.

  • Show directly that (b)TXTX(b) and SSRes are independent, that is without using our existing results that b and SSRes are independent.

Hint: set q = y X then

  1. Show that (b)TXTX(b) = qTX(XTX)1XTq.
  2. Show that SSRes = qT[I X(XTX)1XT]q and hence that these two quadratic forms are independent.

    6

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] MAST30025 Lab 6
$25