Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: -gmm- substitutable expression with an AR process

 From Scott Merryman To statalist@hsphsun2.harvard.edu Subject Re: st: -gmm- substitutable expression with an AR process Date Fri, 12 Aug 2011 13:36:46 -0500

```On Wed, Aug 10, 2011 at 9:55 AM, Daniel Borowczyk Martins
<stata.danielbm@gmail.com> wrote:
> Hello stata users,
>
> I have a question regarding the use of -gmm-'s substitutable expression option.
>
> Consider a 3 year time series data set, with monthly observations and
> variables "y x year"
>
> I want to run the following model " y = xb  year2 year3" where year#
> are year dummies.
>
> I assume the residual is AR(1) with autoregressive parameter rho and
> therefore take quasi-differences to the model.
>
> x is assumed endogenous and I therefore use its own and y's second lag
> as instruments.
>
> I use stata's -gmm- to implement my estimation procedure.
>
> tab year, gen(year)
>
> local yd "year2 year3"
>
> gmm (y - l.y - (1 - {rho})*{b0} - (x1*{b1} - l.x1*{rho}*{b1}) - ({xb:
> `yd'} - {rho}*{xb: l.(`yd')})), instruments(`yd' l(1/2).(y x))
>
> I get the following error message "xb already declared a linear combination".

Use a different equation name for the second xb term.

For example:

sysuse sp500,clear
tsset date
gmm (close-  {xb:volume high} - {xb2: low change}), instruments(l(1/3).vol)

Scott

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