# Re: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)?

 From "Rodrigo A. Alfaro" To Subject Re: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)? Date Wed, 8 Nov 2006 11:18:31 -0500

```Derren,

In order to be posted, your message has to be plain-text format.
Using -xtregar- you are running the following model

y(i,t) = x(i,t)*b + e(i,t)
e(i,t) = r*e(i,t-1) + u(i,t)

To deal with this system the procedures work in the following way:
(1) Take the first eq in period t-1 and multiply by r
r*y(i,t-1) = x(i,t-1)*b*r + r*e(i,t-1)
(2) Substract the result from the first equation
y(i,t) -r*y(i,t-1) = x(i,t)*b - x(i,t-1)*b*r + e(i,t) - r*e(i,t-1)
(3) Note that the composed residual is indeed u(i,t) using the second
equation (main assumption of this procedure), then the model is:
y(i,t) = r*y(i,t-1) + x(i,t)*b - x(i,t-1)*b*r + u(i,t)
(4) This is the constrained version of the following model
y(i,t) =r*y(i,t-1) + x(i,t)*b + x(i,t-1)*c + u(i,t)

You can try

xtreg CONT L.CONT L(0/1).(AIRFORCE ARMY NAVY
L2_UNEMP L2_WAR L2ADD_PA L2_RETUR), fe level(90)

and compare the results with your sentence (-xtregar...-). If they
are similar, then the initial observations are irrelevant and you can
estimate

xtreg CONT L.CONT L2.CONT L(0/2).(AIRFORCE ARMY NAVY
L2_UNEMP L2_WAR L2ADD_PA L2_RETUR), fe level(90)

Also, note that Mark Schaffer's suggestion involves only change
the standard errors (the coefficient will be the same as -xtreg..., fe-
without lags). You can use his -xtivreg2- to create this corrected
standard errors.

The procedure behind -xtregar..., fe- is lag dependent variable plus
fixed effects which is known to be biased. The bias is small for large T
(above 10). The standard way to deal with is using Arellano-Bond
procedure (-xtabond- or -xtabond2-) which solve this model in first
differences using Instrumental Variables (any AR(p)).

I hope this helps you.
Rodrigo.

----- Original Message -----
From: Burrell Derren P Maj AFIT/ENV
To: ralfaro76@hotmail.com
Sent: Wednesday, November 08, 2006 10:30 AM
Subject: FW: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)?

For some reason the stata listserv is posting my reply.  Can you help me out
Thanks,
Derren

-----Original Message-----
From: Burrell Derren P Maj AFIT/ENV
Sent: Wed 11/8/2006 8:44 AM
To: statalist@hsphsun2.harvard.edu; statalist@hsphsun2.harvard.edu
Subject: RE: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)?

Rodrigo,
Can you outline how to do either of the things you mention (I'm a neophyte
when it comes to Stata, basic regression is all I know).  After pulling in
my data I set the panel data by doing this:

tsset RANK2 YEAR, yearly

Then I run the panel AR(1) disturbance model by doing this:

xtregar CONT AIRFORCE ARMY NAVY L2_UNEMP L2_WAR L2ADD_PA L2_RETUR, fe
rhotype(dw) level(90) lbi

How do I use the ARIMA function or run the unrestricted model?

Thanks in advance for the help.
Derren
----- Original Message -----
From: "Rodrigo A. Alfaro" <ralfaro76@hotmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, November 07, 2006 11:29 PM
Subject: Re: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)?

Someone suggested that you can use -arima- in panel data
using the option conditional.

In addition, you can run the unrestricted model (losing 2 times
# of cross-sectional observations) -xtreg y L(1/2).y L(0/2).x, fe-

Rodrigo.

----- Original Message -----
From: "David Jacobs" <jacobs.184@sociology.osu.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, November 07, 2006 8:20 PM
Subject: Re: st: Panel Model w/ AR(1) Disturbance -- Can I do an AR(2)?

I use both EViews and Stata.  I don't think you can correct for
serial correlation at more than one lag in Stata.

I'd be extremely interested if anyone on the list knows better.  If
so, please let us both know exactly how to do this.

Maj. Burrell, why don't you use EViews?  Although Stata is a great
program, the learning costs certainly are lower with EViews.

Dave Jacobs

At 07:59 PM 11/7/2006, you wrote:
>Hello,
>I'm a student trying to finish the data analysis portion of my thesis,
>which involves running a panel model on Military Service statistics to
>determine the effects of the retirement plan on retention efforts.  My
>thesis advisor ran the data in EVIEWS with outstanding results, and I'm
>trying to duplicate this in Stata.  I'm running a Panel Model Linear
>Regression w/ Fixed Effects using the AR(1) function in Stata.  Using
>EVIEWS my thesis advisor ran the same model with both an AR(1) and
>AR(2).  How can I do this in Stata, all I see under Panel Model
>regression is the AR(1) function.  I have to use the Panel Model (i.e.,
>ARIMA won't work because of the data I'm using).
>
>
>DERREN P. , Maj, USAF
>Student, AFIT Cost Analysis Program
>Wright-Patterson Air Force Base, OH
>Derren.burrell@afit.edu
>
>
>*
>*   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/

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

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

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