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" <>
To   <>
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

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'

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.



A K Gupta, MD MPH
Michigan State University

*   For searches and help try:

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