CMTH 642 LAB 4

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

1) Consider the data set “mtcars” – Motor Trend Car Road Tests – available in the R environment.
It gives a comparison between different car models in terms of mileage per gallon (mpg),
cylinder displacement(“disp”), horse power(“hp”), weight of the car(“wt”) and some more
parameters. The goal of the model is to establish the relationship between “mpg” as a response
variable with “disp”,”hp” and “wt” as predictor variables. Read the data set “mtcars” in R.
2) Create a subset of these variables from the mtcars data set for this purpose.
3) Prior to building a Regression Model, investigate how the variables are related to one another.
Construct scatter plots of all-pair wise combinations in the data frame. (Hint: Use “plot”)
4) Fit a multiple linear regression model with mileage per gallon (mpg) as the response variable
and cylinder displacement (disp) and horse power (hp) as the explanatory variables. (Hint: Use
“lm”) Afterwards, comment on the output and drive the fitted value.
5) The first test in multiple regression is testing whether the explanatory variables collectively
influence the response variable, i.e.
𝐻0: 𝛽1 = 𝛽2 = ⋯ 𝛽𝑛 = 0
The null hypothesis was that all of the βj’s are equal to zero against the alternative that allows
them to take any values. If we reject this null hypothesis, then this is the same as saying there
is enough evidence to conclude that at least one of the variables has predictive power in our
linear model. Access the results of each test.
6) Sometimes we may be interested in simultaneously testing whether a certain subset of the
coefficients are equal to 0 (e.g. 𝛽3 = 𝛽4=0). We can do this by using a partial F-test. Suppose
we include the variable weight (wt) in our model and interested in testing weather the weight
is significant after taking displacement (dp) and horse power (hp) into account. Perform a
partial F-test to comment on rejecting or failing to reject of the null hypothesis, 𝐻0.
7) Obtain a %95 confidence interval for the mean miles per gallon (mpg) whose horse power
(hp) is 100 and displacement (dp) is 300.
8) Obtain a %95 prediction interval for the mean miles per gallon (mpg) whose horse power (hp)
is 100 and displacement (dp) is 300.