Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Distributed Lag Time Model


From   "A K Gupta" <[email protected]>
To   <[email protected]>
Subject   st: Distributed Lag Time Model
Date   Wed, 18 Oct 2006 09:21:19 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index