Assignment4SolutionsNEW

pdf

School

York University *

*We aren’t endorsed by this school

Course

1300

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

7

Uploaded by SuperHumanOtterMaster523

Report
Assignment #4 Solutions 1. (a) We have the following SAS output after fitting the model: From this, the least-squares regression line is: ˆ y = 2 . 60417 + 0 . 02083 x. (b) We have below the residual versus predicted value plot as well as a Normal QQ plot: Based on the first plot (on the left), we see concerns regarding constant variance. From the QQ plot, we are concerned about normality of the residuals. So there do appear to be model violations. (c) After running the Box-Cox transformation in SAS, we find an optimal λ of λ opt =- 0.4; below is the support SAS output. From here, we transform Y as Y 0 = Y - 0 . 4 - 1 - 0 . 4 and so our new model is: Y 0 = β 0 + β 1 X + ε. Note: If you used increments of 0.05 in your code, you may have gotten λ opt =- 0.35. 1
(d) We fit the new model and obtain the following diagnostic plots: Based on these two plots, there are still concerns regarding constant variance but we seem to have approximate normality for the residuals. (e) From the output in (c), we notice that the value of 0 is inside the confidence interval, so we use the more convenient value of λ conv =0. From here, we transform Y as Y * =log( Y ) and so our new model is: Y * = β 0 + β 1 X + ε. 2. (a) First notice that we would use Weighted Least Squares since the variance is not constant. S W ( β ) = ( Y - ) 0 W ( Y - ) = Y 0 W Y - Y 0 W xβ - β 0 x 0 W Y + β 0 x 0 W xβ The terms Y 0 W xβ and β 0 x 0 W Y are scalars and Y 0 W xβ = ( β 0 x 0 W Y ) 0 and so Y 0 W xβ = β 0 x 0 W Y . We then have: S W ( β ) = Y 0 W Y - 2 β 0 x 0 W Y + β 0 x 0 W xβ = ∂S W ( β ) β = - 2 x 0 W Y + 2 x 0 W xβ = 0 = - 2 x 0 W Y + 2 x 0 W xβ = ˆ β W LS = ( x 0 W x ) - 1 x 0 W Y (b) To show ˆ β W LS is unbiased is to show E ( ˆ β W LS ) = β ; we have: E ( ˆ β W LS ) = E ( x 0 W x ) - 1 x 0 W Y = ( x 0 W x ) - 1 x 0 W E ( Y ) = ( x 0 W x ) - 1 x 0 W ( ) = β 2
(c) First for Var( ˆ β W LS ): Var( ˆ β W LS ) = Var ( ( x 0 W x ) - 1 x 0 W Y ) = ( x 0 W x ) - 1 x 0 W Var( Y ) ( ( x 0 W x ) - 1 x 0 W ) 0 = ( x 0 W x ) - 1 x 0 W Var( Y ) W 0 x ( x 0 W x ) - 1 Note the following facts: 1) { ( x 0 W x ) - 1 } 0 = ( x 0 W x ) - 1 since it is a symmetric matrix 2) W 0 = W because W is diagonal 3) Var( Y ) = Var( ) = σ 2 V . Since V = W - 1 , σ 2 V = σ 2 W - 1 . So we have Var( ˆ β W LS ) = ( x 0 W x ) - 1 x 0 W ( σ 2 W - 1 ) W x ( x 0 W x ) - 1 = σ 2 ( x 0 W x ) - 1 x 0 W W - 1 W x ( x 0 W x ) - 1 = σ 2 ( x 0 W x ) - 1 x 0 W x ( x 0 W x ) - 1 = σ 2 ( x 0 W x ) - 1 And similarly, Var( ˆ β OLS ) = Var ( ( x 0 x ) - 1 x 0 Y ) = ( x 0 x ) - 1 x 0 Var( Y ) ( ( x 0 x ) - 1 x 0 ) 0 = ( x 0 x ) - 1 x 0 Var( Y ) x ( x 0 x ) - 1 Using the fact that Var( Y ) = σ 2 W - 1 : Var( ˆ β OLS ) = ( x 0 x ) - 1 x 0 σ 2 W - 1 x ( x 0 x ) - 1 3. (a) After entering the data in SAS and running proc reg , we obtain: Therefore the least-squares regression line is: ˆ y = 19 . 47269 + 3 . 26981 x. (b) Below is a plot of the response (computer time) versus the covariate (total number of responses): 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
There seems to be a “fanning out” pattern, indicating issues with the assumptions on the error terms (assumption of mean 0). (c) Here is the vector wt =1 /s 2 i from running the proc reg as instructed: 4
(d) Based on the output below: the new least-squares regression line is: ˆ y = 17 . 30064 + 3 . 42111 x. While the regression coefficients have not changed much and the R 2 has only increased slightly, we also have the following plots of weighted residuals versus predicted value and versus covariate: which shows much better behaved (are no longer fanning out), i.e., we see random scatter; this means we seem to no longer have two violated assumptions (E( ε i )=0 and constant variance. 4. (a) The requested scatterplot is: 5
(b) We fit the model using OLS and find the following diagnostic plot: which clearly shows violation of constant variance. This violation is also evident in the residual versus fitted values plot: Therefore, weighted least-squares is preferable since it will aim at correcting this. (c) The weights are unknown but we have replicated measures, so we can estimate the sample variance of the response at each dosage level. Using the reciprocal of these variances as weights, we fit the model and obtain the following output: which gives the fitted regression line as: ˆ y = 4 . 66419 - 0 . 00659 x. 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
(d) We can look at a plot of the weighted residuals versus predicted value: The behaviour of the residuals is much better and we now have evidence to support the assumption of constant variance. 7