1. [25 points Given are 5 observations for y and two predictors i and 2 as follo
ID: 3376585 • Letter: 1
Question
1. [25 points Given are 5 observations for y and two predictors i and 2 as follows. ?|10 891211 r 1 01 r2 0 00 1 Suppose that we consider a multiple linear model: for i 5, iid (a) Find the least square estimate and the fitted regression equation using R (b) Provide an ANOVA table and find the F statistic for H0 : Bi-Ag-0. (c) Find the F statistic for Ho:B1+82-0 (d) Find the estimate of Cov(A.32) (e) Compute the internally studentized residual, externally studentized residual and Cook's distance for the first observation (y??,T2)-(10,-1,-1). Use R command ls. diag.Explanation / Answer
a)
y<-c(10,8,9,12,11)
x1<-c(-1,-1,0,1,1)
x2<-c(-1,0,0,0,1)
m1<-lm(y~x1+x2)
m1 gives us
from OLS we get
Residuals:
1 2 3 4 5
5.000e-01 -1.110e-16 -1.000e+00 -5.551e-17 5.000e-01
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10.0000 0.3873 25.820 0.0015 **
x1 2.0000 0.6124 3.266 0.0823 .
x2 -1.5000 0.8660 -1.732 0.2254
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.866 on 2 degrees of freedom
Multiple R-squared: 0.85, Adjusted R-squared: 0.7
F-statistic: 5.667 on 2 and 2 DF, p-value: 0.15
equation is y=10+2x1-1.5x2
b)
F at 1,3 and .05 level is 10.1280
as F > F critial we reject the null
so at least one of B1 or B2 is not zero
c)
from R we get
Linear hypothesis test
Hypothesis:
x1 + x2 = 0
Model 1: restricted model
Model 2: y ~ x1 + x2
as P is >.05 we fail to reject null that b1+b2 =0
d)
using R we get
> vcov(m1)
e)
using R ls.diag we get
cooks 8.641975e-01
internal studentised 1.054093
external studentize 1.118034
source of varaiation DF SS MS F regression 1 8.5 8.5 17 residual error n-2= 3 1.5 .5 total n-1= 4 10Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.