I believe the problem is in the -args- statement: matname should not
be enclosed in quotes.
Scott
----- Original Message -----
From: A K Gupta <[email protected]>
Date: Wednesday, October 18, 2006 8:25 am
Subject: st: Distributed Lag Time Model
To: [email protected]
> 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?
*
* 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/