Using the sat data (In the R package \"Faraway\"): (a) Fit a model with total sa
ID: 3794138 • Letter: U
Question
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)
Explanation / Answer
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)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.