

Please answer 5, 6, 7, 8, 9, 10.
We define the following matrices
The regression equation that we want to estimate is
5) The estimate of coefficients is
We use the following R code to calculate this
#set Y
Y<-c(16,5,10,15,13,22)
#set x
x<-c(4,1,2,3,3,4)
#set the matrix X
X<-matrix(c(rep(1,6),x),ncol=2)
#part 4)
XX<-solve(t(X)%*%X)
#print
XX
#part 5)
b<-XX%*%(t(X)%*%Y)
#print
sprintf('The estimated intercept is %.4f',b[1])
sprintf('The estimated slope is %.4f',b[2])
sprintf('The estimated regression equation is
yhat=%.4f+%.4fx',b[1],b[2])
#get this
![sprintf (The estimated intercept is 4f,b[l] [1] The estimated intercept is 0.4390 sprintf (The estimated slope is .4f,b](http://img.homeworklib.com/questions/f2d690e0-717b-11ea-9659-17c8ccfa0741.png?x-oss-process=image/resize,w_560)
6) The residual is calculated using
R code
#part 6)
e<-Y-X%*%b
#print
e
#get this

7) The hat matrix H is
R code is
#part 7)
H<-X%*%XX%*%t(X)
#print
H
#get this
![> H ,2 31 ,4 ,5] ,6] [1, 0.36585366 -0.1463415 0.02439024 0.1951220 0.1951220 0.36585366 [2,-0.14634146 0.6585366 0.39024390](http://img.homeworklib.com/questions/f3a13170-717b-11ea-a4c6-27d35a1dc671.png?x-oss-process=image/resize,w_560)
8) The sum of square SSE is
where
R code
#part 8)
sse<-t(e)%*%e
#print
sprintf('SSE=%.4f',sse)
# get this
![sprintf (SSE=%.4I,Sse) [1] SSE 20.2927](http://img.homeworklib.com/questions/f40dce70-717b-11ea-b10d-19bbae604308.png?x-oss-process=image/resize,w_560)
9) the estimate of variance of regression is
The variance-covariance matrix is
R code
#part 9)
#get the estimate of regression variance
mse<-sse/(6-2)
#get the estimate of variance-covariance
cvb<-drop(mse)*XX
#print
sprintf('Var(b0)=%.4f',cvb[1,1])
sprintf('Var(b1)=%.4f',cvb[2,2])
# get this
![sprintf(Var (b0)=.4f,cvb[1,1]) [1] Var (b0) =6.8055 sprintf(Var (bl) =% .4f, cvb [2, 2] ) [1 Var (bl) =o.7424](http://img.homeworklib.com/questions/f4696a00-717b-11ea-8694-6d8e50cc9fa4.png?x-oss-process=image/resize,w_560)
10) The variance of yhat at
is
R code
#part 10)
#set xh
xh<-c(1,2)
s2yhat<-drop(mse)*(t(xh)%*%XX%*%xh)
#print
sprintf('s2(yhat)=%.4f',s2yhat)
#get this

Code to all the parts together
#set Y
Y<-c(16,5,10,15,13,22)
#set x
x<-c(4,1,2,3,3,4)
#set the matrix X
X<-matrix(c(rep(1,6),x),ncol=2)
#part 4)
XX<-solve(t(X)%*%X)
#print
XX
#part 5)
b<-XX%*%(t(X)%*%Y)
#print
sprintf('The estimated intercept is %.4f',b[1])
sprintf('The estimated slope is %.4f',b[2])
sprintf('The estimated regression equation is
yhat=%.4f+%.4fx',b[1],b[2])
#part 6)
e<-Y-X%*%b
#print
e
#part 7)
H<-X%*%XX%*%t(X)
#print
H
#part 8)
sse<-t(e)%*%e
#print
sprintf('SSE=%.4f',sse)
#part 9/10)
#get the estimate of regression variance
mse<-sse/(6-2)
#get the estimate of variance-covariance
cvb<-drop(mse)*XX
#print
sprintf('Var(b0)=%.4f',cvb[1,1])
sprintf('Var(b1)=%.4f',cvb[2,2])
#part 10)
#set xh
xh<-c(1,2)
s2yhat<-drop(mse)*(t(xh)%*%XX%*%xh)
#print
sprintf('s2(yhat)=%.4f',s2yhat)
Please answer 5, 6, 7, 8, 9, 10. 5.5. Consumer finance. The data below show, for...
5.13. Refer to Consumer finance Problem 5.5. Find (XX)1 5.5. Consumer finance. The data below show, for a consumer finance company operating in six cities, the number of competing loan companies operating in the city (X) and the number per thousand of the company's loans made in that city that are currently delinquent (Y): 2 4 5 2 Y: 16 5 101513 22 4 4 Assume that first-order regression model (2.1) is applicable. Using matrix methods, find (1) Y'Y, (2)...
X 3 5 7 5 6 7 9 4 8 6 Y 6 9 12 10 14 12 14 8 15 10 Discuss the relation between X and Y using an appropriate method. If possible, try to find the relation between X and Y treating X as independent variable?
please answer all parts
10 9 8 7 6 5 4 3 2 1 9. I know which countries tend to cluster in similar sociocultural and economic groupi 10 9 8 7 6 5 4 3 2 1 2. I frequently attend seminars and lectures about other cultures or international topics. 10 9 8 7 6 5 4 3 2 1 3. I believe female expatriates can be equally as effective as male expatriates. 10. I feel capable of assessing...
(A) (B) (C) 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 Using supply and demand diagram (A) above, Identify the consumer surplus, producer surplus, and total surplus when the market is in equilibrium. Using supply and demand diagram (B) above, Identify the consumer surplus, producer surplus, total surplus, and deadweight loss when the price is...
8 α = (д 1 9 2 5 3 4 5 10 3 6 7 86 9 10 2 7 10) 1 4 1 в = (1, 2 3 3 5 4 8 5 2 6 9 7 7 8 4 9 6 10 1 10) 10 8 ү 1 3 2 7 3 9 4 5 1 5 6 7 8 2 9 4 19) 10 1 ө ( 42 2 4 5 4 6 5 2 6 7...
Draw the graph of f(x) = – 64 – 1 10+ 9 8 7 6 5 3 2 1 10 -9 -8 -7 -6 -5 -4 -3 -2 - / - 1 1 2 3 4 5 6 7 8 9 10 N -3 -4 -5 -6 -7 -8 -9 1A
(1) Write the permutation 1 2 3 4 5 6 7 8 9 10 7 5 10 3 8 9 6 2 4 ( 10 1 as a product of disjoint cycles.
The graph of f(x) is given below: 11 godina osno obs 11-10-9-8 -7 -6 -5 4 -3 -2 - 1 2 3 4 5 6 7 8 9 10 11 12 a-Draw a tangent to the given figure for x=9 and explain in a few words what this line tells us about the curve of the function f(x). b. In the interpretation of f19), it is said that the result oives an approximation of the function asx is increased by...
3 5 6 7 8 9 10 11 12 The following are the annual salaries of 17 chief executive officers of major companies. (The salaries are written in thousands of dollars.) 157, 1250, 743, 562, 1108, 428, 181, 609,700, 362, 586, 271, 542, 134,315,790, 723 Find 10th and 75th percentiles for these salaries. (If necessary, consult a list of formulas.) (a) The 10th percentile: (thousand dollars (b) The 75th percentile: thousand dollars X ?
Given the following sets: S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, Even numbers A = {2, 4, 6, 8, 10}; Odd number B = {3, 5, 7, 9}; Natural numbers N = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and Prime numbers C = {2, 3, 5, 7} Find the following: a) A ∪ C b) A ∩ N c) A ’ d) B ∩ N e) B ∪ N f) C...