Question

5.5. Consumer finance. The data below show, for a consumer finance company operating in six cities, the number of competing l• Chapter 5, 5.5 41), (2), (31 and 4)(XX)--((5)b, (6), (7)H,(8)SSE, (9)Var(bo), Var(61), (10) sº(ûn) when Ih = 2.)? You can

Please answer 5, 6, 7, 8, 9, 10.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

We define the following matrices

1 4 16 5 1 1 E1 |В1 В - 62 10 X = 15 1 2 E2 Y E= 3 1 1 3 13 E6 22 1 4

The regression equation that we want to estimate is

YXB+

5) The estimate of coefficients is

b(X X)xY -1 [16 1 4 1 1 5 1 1 1 1 4 1 2 3 3 4 1 1 41 2 3 34 1 1 1 1 2 1 1 10 1 3 15 1 3 13 1 4 22

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

6) The residual is calculated using

eY-Y=Y- Xb

R code

#part 6)
e<-Y-X%*%b
#print
e

#get this

1,2.87804878 [2,0.04878049 [3, 0.34146341 [4,0.73170732 [5,- [6, -1.26829268 3.12195122

7) The hat matrix H is

Н Х(Xх)-1х

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

8) The sum of square SSE is

SSE = e e

where

eY-Y=Y- Xb

R code

#part 8)
sse<-t(e)%*%e
#print
sprintf('SSE=%.4f',sse)

# get this

sprintf (SSE=%.4I,Sse) [1] SSE 20.2927

9) the estimate of variance of regression is

SSE 2MSE n- 2

The variance-covariance matrix is

2(xX)

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

10) The variance of yhat at

1 Th 2 is

(h) Xx)h =

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

sprintf (s2 (yhat)-.4f, s2yhat) 1 s2 (yhat) =1.3611

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)

Add a comment
Know the answer?
Add Answer to:
Please answer 5, 6, 7, 8, 9, 10. 5.5. Consumer finance. The data below show, for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5.13. Refer to Consumer finance Problem 5.5. Find (XX)1 5.5. Consumer finance. The data below show,...

    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...

    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...

    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...

    (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...

    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...

    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...

    (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...

    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...

    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},...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT