Statalist The Stata Listserver


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

Re: st: using interactions with lags


From   Michael Hanson <[email protected]>
To   [email protected]
Subject   Re: st: using interactions with lags
Date   Fri, 29 Sep 2006 10:17:41 -0400

On Sep 29, 2006, at 9:44 AM, Scott Cunningham wrote:

Is it possible to use indicator variables interacted with lagged variables using within OLS? For instance,

xi:reg Y i.race*l(0/11)*X i.year, robust

In other words, I want to interact the race dummy variable with 11 lags of the X regressor. I appear unable to do this using the above syntax. SHould I, instead, move to generating the dummies manually and then interacting that with the lag? In other words, is it the -i- operator that is causing the problem?
One likely "problem" is with your notation: L(0/11)*X is not a valid expression for the lag operator. Instead, I suspect you may mean L(0/11).X, as in:

xi:reg Y i.race*L(0/11).X i.year, robust

See -help tsvarlist- for additional information. I do not know for sure if Stata will accept the combination of -xi- with the lag operator, as I do not have a suitable dataset to test it. Hope this helps.

-- Mike

*
* 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