Statalist The Stata Listserver


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

Re: st: Distributed Lag Time Model


From   [email protected]
To   [email protected]
Subject   Re: st: Distributed Lag Time Model
Date   Wed, 18 Oct 2006 08:40:16 -0500

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/



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