Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Problem Set 5

Use the programming language software  Matlab or  Octave to answer the following questions. Print out the results in A4-size paper and turn in the program codes as well (in S 4 pages).

1. Load data.txt into memory and define the columns as y, x1 , x2  and x3 , respec- tively. Let X = (ι, x1 , x2 , x3 ) where ι = (1, 1, . . . , 1)/ .

(a) What is the number of rows of y?  What is the number of columns of X? For this, use the command size(.).

(b)  Obtain the OLS estimates βˆ where the true model is

y = α + x1 β1 + x2 β2 + x3 β3 + e

(c)  Calculate the standard error of βˆi  and the t-value where Ti  = βˆi /se(βˆi ) for each βˆi .

(d) Based on the above results, test the hypothesis H0   : βi  = 0 against H1   : βi    0 at the significance level of α = 0.05.  To find the critical value of t-distribution, use the Octave command tinv(.).

(e) Find the p-value of each βˆi . To calculate the cumulative distribution func- tion of t-distribution, use the Octave command tcdf(.).

(f)  Calculate the coefficients of determination R1(2)  and R2(2)  where

R 1(2)  = 1 _  and R2(2)  = 1 _ 

and compare the results.

(g)  Calculate the adjusted coefficients of determination adj.R1(2) and adj.R2(2) where

adj.R 1(2)  = 1 _  and R2(2)  = 1 _ 

and compare the results.

(h) Test the hypothesis H0  : β1  = β3 + 0.4 against H1  : β1   β3 + 0.4 using the t-test at the 5% significance level.

(i) Write the above hypothesis in the form of H0  : Rβ = r and do the F-test using

(Rβˆ _ r)/ [R(X/X)_1 R/]_1 (Rβˆ _ r)

2

For the critical value of F-distribution, use the Octave command nv(.). (j) Do the F-test using the formula

(RRSS _ URSS)

URSS

where RRSS = restricted residual sum of squares and URSS = unrestricted residual sum of squares. Compare this result with that of (h) and (i).