Using the sat data In the R package Faraway a Fit a model wi

Using the sat data (In the R package \"Faraway\"):

(a) Fit a model with total sat score as the response and expend, ratio and salary as predictors.

(b) Test the hypothesis that H0 : salary = 0.

(c) Test the hypothesis that H0 : salary = ratio = expend = 0. Do any of these predictprs have an effect on the response?

(d) Now add takers to the model. Test the hypothesis that H0 : takers = 0.Compare this model with the previous one using an F-test. Demonstrate that theF-test and t-test here are equivalent.

Library(\"faraway\")

data(sat)

Solution

First you have to run the linear regression using the code -

library(faraway)

fit <- lm(SAT~expend+salary+ratio, data=sat)

Once you run the regression then you can diagonise your model using the following codes -

Test for non constant error variance or test of homoscedasticity -

ncvTest(fit)

You can also plot the studentized residuals vs fitted values using the following code -

spreadLevelPlot(fit)

Using the sat data (In the R package \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site