Hello users
I am trying to fit a Distributed lag model using the analogy presented
by Allen McDowell
www.stata-press.com/journals/sjabstracts/st0065.pdf
The following is a program written by Dr. McDowell to generate a
constraint matrix
program pdlconstraints
version 8.2
args p q `matname'
local r = `p' - `q'
local m = `q' + 1
matrix `matname' = J(`r',`p'+3,0)
forvalues i = 1/`r' {
local x= `i' +`q' +1
local k= -1
local d= 1
for values j = `x'(-1)`i' {
local k= `k' + 1
matrix `matname'[`i',`j'] = `d'*comb(`m',`k')
local d= -1*`d'
}
}
end
This is to be followed by
pdlconstraints p q matname
Stata keeps returning an invalid syntax error.
Can someone point out the error?
Any further help towards distributed lag modeling shall be very welcome
as well.
Thanks
Sincerely
A K Gupta, MD MPH
Michigan State University
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/