Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: SAS proc autoreg and Stata arima


From   Robert A Yaffee <[email protected]>
To   [email protected]
Subject   Re: st: SAS proc autoreg and Stata arima
Date   Wed, 04 Feb 2009 22:12:32 -0500

Dear George,
   I believe that the SAS error parameterization is different from
that of Stata. SAS has  y(t) = X'B + v(t)
where v(t)=e(t) - phi1v(t-1)- phi2v(t-2) - ... - phi(m) v(t-m).
   Meanwhile,  Stata uses
y(t) = X'B + v(t)
  with v(t)= phi1v(t-1)+phi2v(t-2) + ... + phi(m) v(t-m)
    I hope this helps,
        Bob Yaffee


Robert A. Yaffee, Ph.D.
Research Professor
Silver School of Social Work
New York University


Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2008.pdf

CV:  http://homepages.nyu.edu/~ray1/vita.pdf

----- Original Message -----
From: "George Kikuchi 菊池 城治" <[email protected]>
Date: Wednesday, February 4, 2009 12:16 pm
Subject: st: SAS proc autoreg and Stata arima
To: [email protected]


> Hello List,
> 
> My question may be a too simple question to be asked on the list, but 
> I hope some of you may be kind enough to help me out.
> 
> I am trying to replicate somebody else's time series analysis that was 
> conducted in SAS (proc autoreg, in particular).  Below is the SAS code 
> that I am trying to replicate, followed by Stata code that I believe 
> is doing the same analysis.  
> 
> Although the regression coefficient estimates by these codes are 
> virtually the same, the direction of autoregressive error coefficients 
> are in the opposite.
> 
> Am I doing something wrong?  Do I need to specify certain options to 
> get the same results?
> 
> **** SAS code ***
> proc autoreg data=test.japan09 all method=ml;
> model murdr = welf gini unemp drate fl urbanper mpr20_29 clr1/ nlag=(1 
> 2)  dw=6 dwprob;
> run;
> 
> *** Stata code ***
> arima  murdr welf gini unemp drate fl urbanper mpr20_29 clr1, ar(1/2)
> 
> 
> *** SAS output ****
>                                      Standard                 Approx
>  Variable        DF     Estimate        Error    t Value    Pr > |t|   
>  Variable Label
> 
>  Intercept        1      -0.2291       1.3726      -0.17      0.8683
>  WELF             1       0.0901       0.0139       6.50      <.0001
>  GINI             1       2.5837       1.0148       2.55      0.0150
>  UNEMP            1       0.0807       0.0464       1.74      0.0901   
>  
>  DRATE            1      -0.1187       0.1509      -0.79      0.4363   
>  
>  FL               1    -0.009282     0.008776      -1.06      0.2967
>  URBANPER         1      -0.0159     0.007080      -2.25      0.0302  
> 
>  MPR20_29         1       0.1578       0.0270       5.84      <.0001
>  CLR1             1     0.003780     0.003500       1.08      0.2867
>  AR1              1      -0.4149       0.1392      -2.98      0.0049
>  AR2              1       0.5435       0.1374       3.96      0.0003
> 
> 
> 
> 
> *** Stata output***
> ARIMA regression
> 
> Sample:  1951 - 2000                            Number of obs      =   
>      50
>                                                 Wald chi2(10)      =   
> 7883.00
> Log likelihood =  61.32109                      Prob > chi2        =   
>  0.0000
> 
> ------------------------------------------------------------------------------
>              |                 OPG
>        murdr |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
> murdr        |
>         welf |   .0900617   .0143372     6.28   0.000     .0619613     
> .118162
>         gini |   2.583805   .8179648     3.16   0.002     .9806232    
> 4.186986
>        unemp |   .0807053   .0521775     1.55   0.122    -.0215608    
> .1829714
>        drate |  -.1186688   .1867984    -0.64   0.525    -.4847869    
> .2474493
>           fl |   -.009291   .0096179    -0.97   0.334    -.0281418    
> .0095598
>     urbanper |  -.0159288   .0061898    -2.57   0.010    -.0280606   -.0037971
>     mpr20_29 |   .1577909   .0355243     4.44   0.000     .0881645    
> .2274172
>         clr1 |    .003777   .0050106     0.75   0.451    -.0060437    
> .0135977
>        _cons |  -.2280505   1.405894    -0.16   0.871    -2.983553    
> 2.527452
> -------------+----------------------------------------------------------------
> ARMA         |
>           ar |
>          L1. |   .4148975   .1494673     2.78   0.006      .121947     
> .707848
>          L2. |  -.5435063   .1329498    -4.09   0.000    -.8040832   -.2829295
> -------------+----------------------------------------------------------------
>       /sigma |   .0704317   .0093342     7.55   0.000     .0521371    
> .0887263
> ------------------------------------------------------------------------------
> 
> 
> Thank you,
> 
> George
> 
> 
> ***************************************
> George Kikuchi, Ph.D.
> 
> National Research Institute of Police Science
> Department of Criminology and Behavioral Sciences
> Crime Prevention Section
> 
> 6-3-1 Kashiwanoha
> Kashiwa-shi, Chiba 277-0882
> Japan
> 
> TEL: +81-4-7135-8001 ext.2641
> FAX: +81-4-7133-9184
> e-mail: [email protected]
> ***************************************
> *
> *   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/

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



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