Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MTH5120

Statistical Modelling I

Course Work 4

2022

1.  Coursework component

Based on the Hitters dataset available on the library ISLR, relative to Major League Baseball Data from the 1986 and 1987 seasons. We wish to predict a Baseball player’s Salary on the basis of various statistics associated with performance in the previous year. Before working with the data, we need to clean them up, by deleting the missing values for some players:

>Hitters  =na.omit(Hitters)

(a) Use the regsubsets function for running the best model with the maximum number of predictors available, then state: which is the best model according to the adjusted R2 and the Mallow’s statistic? Show it graphically too.

(b) show the coefficients for the two best models and show if they are statistically significant

(c) after looking in details at the results, do you confirm the best model found in (a)?

 

2. Coursework component When fitting the model

E[Yi] = β0 + β1x1,i + β2x2,i

to a set of n = 25 observations, the following results were obtained using the general linear model notation:

XtX =             10232   133899

XtX − 1  =  

−0.00008367

1    6725688 ,

−0.00444859

0.00274378

−0.00004786

XtY =     

337071.69

 

0.000001229

Also YtY = 18310.63 and  = 22.384.

(a) Compute the R2 and adj(R2).

(b) In the same way, run a two dimensional model:

to the same set of 25 observations and we have the following results:

XtX =     ,   XtX − 1  = 

XtY = 

 

Compute the R2 and the adjusted R2

(c) Which is the best model across the two models, the one with two explanatory variables or the one with one explanatory variable.