* Restricted Investment Equation
*
* Keywords:
* regression, ols, log, investment, equation, restricted, test
*
* Description:
* We illustrate how to estimate an Investment Equation with various
* restrictions on it and how to test these restrictions
*
* Author(s):
* Noel Roy
* Skif Pankov
*
* Source:
* William H. Greene, Econometric Analysis - 7th Edition
* Pearson International Edition, Chapter 5, Example 5.3 (page 160)
*
* Reading the datafile and naming the variables, specifying to ignore the
* first line of the file
read (TableF5-2.shd) year qtr realgdp realcons realinvs realgovt realdpi &
cpi m1 i unemp pop deltap realint / skiplines=1
* Setting the first time period to be equal to year 1950 with periodicity of
* one quarter
time 1950.1 4
sample 1950.2 2000.4
* Generating variables
genr lni=log(realinvs)
genr lny=log(realgdp)
genr t=time(-1)
* Estimating the restricted model (since realint=i-deltap)
ols lni realint lny t
* Estimating the unrestricted model, which has both i and deltap instead
* of realint.
ols lni i deltap lny t /pcov
* Testing the null hypothesis that b2+b3=0, which is equivalent to the
* restricted model
*
test i+deltap = 0
* Testing the restricted model directly
ols lni realint deltap lny t
* Testing the joint hypothesis that b2+b3=1, b4=1 and b5=0 are true
?ols lni i deltap lny t
test
test i+deltap
test lny=1
test t
end
* Testing the three restrictions one at a time with simple test commands
*
test i+deltap
test lny=1
test t
stop