Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

st: orders of operation for a seasonal difference quadratic regression using factor variables

 From "Dimitriy V. Masterov" To Statalist Subject st: orders of operation for a seasonal difference quadratic regression using factor variables Date Wed, 8 Aug 2012 16:25:04 -0700

```I have monthly panel data on unemployment (uerate) and an outcome of
interest (lny) by US county. I ran the following 12-month seasonal
difference regression with a quadratic unemployment term (lagged one
month to give my counties time to adjust):

regress S12.(lny cL1.uerate##cL1.uerate) i.countyid#c.dateym, vce(cluster state)

My (misguided) intuition is that Stata would expand the factor
variables and then do the seasonal differencing, resulting the OLS
regression:

lny_{t}-lny_{t-12} = a + b*(x_{t-1}-x_{t-13}) + c *
(x_{t-1}^2-x_{t-13}^2) + county-specific trend.

Stata actually seems to be estimating:

lny_{t}-lny_{t-12} = a + b*(x_{t-1}-x_{t-13}) + c *
(x_{t-1}-x_{t-13})^2 + county-specific trend.

The manual says that D. and S. operators may not be combined with
factor variables. It provides a categorical variable example, which
makes sense, but does not apply here. There's no error message and
Stata actually estimates something, but I can't seem to find the logic
anywhere in the pdf documentation.

DVM
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```