Different results with EViews5 and STATA

For questions of any nature based on EViews 5 or earlier versions of EViews.

Moderators: EViews Gareth, EViews Moderator

joseluis
Posts: 3
Joined: Thu Feb 05, 2009 9:02 am

Different results with EViews5 and STATA

Postby joseluis » Thu Feb 05, 2009 9:34 am

I am working with panel data and have run the Levin-Lin-Chu test. I've got Eviews 5.0 and Stata10. I'm using, obviously, the same dataset, although in Stata, I'm using the dataset in long format whereas in Eviews I'm using the wide format with the panel identifiers. In principle, I should obtain the same results. I'm posting this because I am not obtaining -not even remotely- the same results. I guess I'm doing something wrong -not that there's a bug in either Eviews or Stata- so I would request your help.
Just to check, in Eviews I'm running a LLC test with constant only (ie Individual effects only) with 5 lags and the other options just as they come by default (ie levels, Bartlett, Newey-West, etc). Results:
Method Statistic Prob.**
Levin, Lin & Chu t* 1.65623 0.9512

Or, in full:

Null Hypothesis: Unit root (common unit root process)
Date: 02/05/09 Time: 16:29
Sample: 1950 1992
Series: GDP_CAN, GDP_FRA, GDP_GER, GDP_ITA, GDP_JPN,
GDP_UK, GDP_US
Exogenous variables: Individual effects
User specified lags at: 5
Newey-West bandwidth selection using Bartlett kernel
Total (balanced) observations: 259
Cross-sections included: 7

Method Statistic Prob.**
Levin, Lin & Chu t* 1.65623 0.9512

** Probabilities are computed assuming asympotic normality

Intermediate results on GDP?

2nd Stage Variance HAC of Max Band-
Series Coefficient of Reg Dep. Lag Lag width Obs
GDP_CAN -0.00090 138615 184603 5 5 1.0 37
GDP_FRA -0.01037 29938. 45926. 5 5 2.0 37
GDP_GER -0.00246 42449. 50967. 5 5 4.0 37
GDP_ITA 0.01305 23416. 32129. 5 5 1.0 37
GDP_JPN 0.00504 38483. 120962 5 5 4.0 37
GDP_UK 0.02642 37582. 51817. 5 5 4.0 37
GDP_US 0.00550 104951 44935. 5 5 11.0 37

Coefficient t-Stat SE Reg mu* sig* Obs
Pooled 0.00309 0.636 1.008 -0.539 0.860 259

If I tick the option 'use balanced sample', the result varies to:
Levin, Lin & Chu t* 1.67675 0.9532


In Stata, I'm using the Levinlin package and, again, I've chosen the constant deterministics and 5 lags. Results:
Levin-Lin-Chu test for g7 Deterministics chosen: constant

Pooled ADF test, N,T = (7,43) Obs = 259
Augmented by 5 lags (average) Truncation: 10 lags

coefficient t-value t-star P > t
-0.03736 -2.052 0.76078 0.7766

Again, I'm sure I'm doing something wrong, but I cannot realise what. Could you please help me? Even an explanation of any theoretical differences in how EVIEWS and STATA approach this issue, if any, would help.

Regards,

José

José Luis Iparraguirre
Senior Research Economist
Economic Research Institute of Northern Ireland
Floral Buildings
2 -14 East Bridge Street
Belfast BT1 3NQ
Northern Ireland
United Kingdom

EViews Glenn
EViews Developer
Posts: 2552
Joined: Wed Oct 15, 2008 9:17 am

Re: Different results with EViews5 and STATA

Postby EViews Glenn » Thu Feb 05, 2009 9:46 am

Not being familiar with the Stata Levinlin package I can't say for certain, but given the relative simplicity of Levin-Lin-Chu, I would guess that it has to do with differences in degree-of-freedom corrections for the variances used in the ADFs. This isn't a theoretical difference, but rather a practical difference in computation of the long-run variances. With 37 observations per cross-section and 5 lags per cross-section, I would expect df differences to yield test statistic differences on the order of what you report.

Does the Stata module offer intermediate results for the second-stage ADF regression? That would help us track down the nature of the differences.

joseluis
Posts: 3
Joined: Thu Feb 05, 2009 9:02 am

Re: Different results with EViews5 and STATA

Postby joseluis » Fri Feb 06, 2009 5:47 am

Thank you for the prompt reply. I contacted the author of Levinlin (Kit Baum, from Boston College) and he guided me as to how to obtain any further results.
It may not be enough, but this is what I got:

Levin-Lin-Chu test for g7 Deterministics chosen: constant

Source | SS df MS Number of obs = 259
-------------+------------------------------ F( 1, 258) = 4.20
Model | 4.35181272 1 4.35181272 Prob > F = 0.0415
Residual | 267.588441 258 1.0371645 R-squared = 0.0160
-------------+------------------------------ Adj R-squared = 0.0122
Total | 271.940253 259 1.04996237 Root MSE = 1.0184

------------------------------------------------------------------------------
__000004 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
__000006 | -.0373616 .0182396 -2.05 0.042 -.0732789 -.0014442
------------------------------------------------------------------------------

Still puzzled, but confident!
Regards,

José Luis

EViews Glenn
EViews Developer
Posts: 2552
Joined: Wed Oct 15, 2008 9:17 am

Re: Different results with EViews5 and STATA

Postby EViews Glenn » Fri Feb 06, 2009 2:21 pm

Most probably a d.f. correction issue. Can you send your workfile to support@eviews.com.

We might not get a chance to look at it until next week as there are quite a few things going on right now, but we'll see if we can take a look.

EViews Glenn
EViews Developer
Posts: 2552
Joined: Wed Oct 15, 2008 9:17 am

Re: Different results with EViews5 and STATA

Postby EViews Glenn » Tue Feb 10, 2009 5:17 pm

I've spent a bit of time looking into the differences between the Stata/levinlin and EViews results and have some answers. The following discussion refers to both EViews 5.1 and EViews 6, in comparison with the 1.1.5 version of the levinlin ado.

There are four reasons for differences between the levinlin and EViews results, two of which (*) are minor:

1. EViews and levinlin estimate different base test specifications.
*2. levinlin uses estimates for the individual cross-section residual variances which use a slightly different denominator than that described in Levin-Lin-Chu (2002) and used in EViews.
3. EViews and levinlin employ a different bandwidths for the kernel estimator of the long-run variance of the differenced series.
*4. EViews uses interpolated values for the mu* and sigma* values used in constructing the final test statistic, while levinlin uses threshold values.

I'll discuss these below in depth.
-----

Of these 4 differences, 2 and 4 are relatively minor so let's talk about 1 and 3 first.

1. The Levin-Lin-Chu estimator requires first-stage estimates of an ADF equation for each cross-section. In keeping with the main result in the Levin-Lin-Chu (1992) paper, EViews estimates this ADF using the differences of the original series. levinlin adopts the variant of the estimator which first removes cross-section averages from the data (on p. 13 of the Levin-Lin-Chu paper). There isn't any discussion in the levinlin docs about the fact that they perform this adjustment and so far as I can tell, there is no way to instruct levinlin not to remove the cross-section averages. Therefore in order to match results, one must remove the period-means from the data prior to performing the test in EViews.

The first task is therefore to compute series containing deviations from cross-sections means. The data that I received was set up as a pool ("wide" in Stata terminology). Suppose we name the pool series in question X?. To remove the time-means from the pool series X? requires two simple steps. First, use the pool to create a group containing X?. You can do this interactively by selecting Proc/MakeGroup then enter "X?", and naming the resulting group XGROUP, or you can issue the command,

Code: Select all

pool01.makegroup(xgroup) x?

Next use the pool genr command to create the adjusted series

Code: Select all

pool01.genr xm? = x?-@rmeans(xgroup)

which removes the row (by-period) means. We will perform the remaining analysis using the pool series XM?.

If in a panel workfile setting, it's even easier, just issue the command

Code: Select all

series xm = x - @meansby(x, @year)

since in this case, the data are observed on an annual basis. The remaining analysis should be performed with the series XM.

3. By default, both EViews and the levinlin program employ non-parametric (Bartlett) kernel methods to estimate the cross-section specific long-run variances. The default bandwidth for levinlin (generally) uses the value 3.21*(T-ALAGS-1)^(1/3), where ALAGS is the average number of ADF lags, to match the Monte Carlo analysis provided by Levin-Lin-Chu. In this example, the bandwidth is 10. In EViews, the default setting uses the plug-in automatic Newey-West method which chooses a variety of bandwidths for the different cross-sections. As a result of the differing bandwidths, the default estimates of the long-run variances are quite different. To get results that are close to the levinlin results, you must set the EViews bandwidth to 10.

To summarize the first two issues, using the time-mean adjusted data and setting the EViews bandwidth values to match the levinlin gets us very close.
The command form for the test with these settings is:

Code: Select all

pool01.uroot(llc, lag=5, band=10) xm?

The EViews results for the modified data, with the correct bandwidth settings are:

Levin, Lin & Chu t* 0.72290 0.7651
Coefficient t-Stat SE Reg mu* sig* Obs
Pooled -0.03736 -2.052 1.030 -0.539 0.860 259

while as before, the levinlin results are:

coefficient t-value t-star P > t
-0.03736 -2.052 0.76078 0.7766


The remaining two items are relatively minor:

2. One component of the computed statistic is the residual variance from the ADF regressions. Levin-Lin-Chu use T-p-1 in the denominator of this expression; T-1 for the number of observations remaining after taking first differences, and subtracting off p for the number of observations lost to including p lags in the ADF regression. EViews follows this computation. levinlin differs ever-so-slightly by subtracting 1 off of this denominator. This difference should have no practical impact asymptotically, but does mean that a couple of later calculations in the user's example differ between the two by (sqrt(37/36)).

4. There are a couple of adjustment terms mu* and sigma* that are used in the final computation of the test statistics. A table of these terms, indexed by the type of specification and the average number of time observations, is provided by Levin-Lin-Chu (p. 14). When using these values, levinlin uses the average T adjusted for lags and chooses the next highest level (e.g., using the 37 obs in the adjusted T for this case will use the Levin-Lin-Chu entry for 40 obs). EViews also adjusts the average T for lags, but linearly interpolates the value. For example, in your case, the levinlin mu* value is -.537, while the EViews value is -.5394.

The remaining differences between the EViews and levinlin results are entirely due to (2) and (4). I have verified that modifying results for the differences described in (2) and (4) results in identical values.

If you'd like, I can send you the workfile that I created with the adjusted data.

joseluis
Posts: 3
Joined: Thu Feb 05, 2009 9:02 am

Re: Different results with EViews5 and STATA

Postby joseluis » Mon Feb 16, 2009 7:53 am

Thank for for such a thorough analysis. It's mindblogging to see how far two software packages can go not just in terms of default options but of internal procedures and calculations. Plese, send me the series you have created to obtain the results. Regards,
José

EViews Glenn
EViews Developer
Posts: 2552
Joined: Wed Oct 15, 2008 9:17 am

Re: Different results with EViews5 and STATA

Postby EViews Glenn » Mon Feb 16, 2009 10:51 am

While your point about there being perhaps unsurprising differences in implementation is certainly true, I do want to note that In the program Stata Levin-Lin program in question is not an official Stata routine with all of the vetting that that entails, but rather one written by users for their particular needs.

And given that this literature in particular has a variety of specifications that one could run and various choices for things (like kernels, and bandwidths) so to some extent the end-user should naturally understand that when you say you are doing a "Levin-Lin-Chu panel unit root test", that it isn't a sufficient description of the problem. EViews is pretty clear in its documentation exactly how we are doing the computations for the test (and we give you various options for controlling most of the things that user's might want to control), but our way is certainly not the only way (as you have seen) to do the computations.

Thea
Posts: 5
Joined: Wed Mar 25, 2009 7:17 am

Re: Different results with EViews5 and STATA

Postby Thea » Mon Mar 30, 2009 11:13 am

Hello,

I am trying to make the within estimator manually, by removing the cross-sectional means from the original pool data series. Following on from your hints provided in this post, I'm trying the following commands, but they're not working. Do you have any suggestions please?

pool1.makegroup(cgroup) cost?

pool.genr wicost? = cost?-@cmeans(cgroup)

Many thanks.

Best wishes,

Thea.

EViews Glenn
EViews Developer
Posts: 2552
Joined: Wed Oct 15, 2008 9:17 am

Re: Different results with EViews5 and STATA

Postby EViews Glenn » Mon Mar 30, 2009 12:29 pm

In the pool context, the syntax is slightly different

Code: Select all

pool.genr wicost? = cost?-@mean(cost?)

Thea
Posts: 5
Joined: Wed Mar 25, 2009 7:17 am

Re: Different results with EViews5 and STATA

Postby Thea » Tue Mar 31, 2009 7:29 am

Done it again - thanks very much Glenn!

Yours appreciatively,

Thea.

arthur
Posts: 9
Joined: Wed May 18, 2011 11:37 pm

Re: Different results with EViews5 and STATA

Postby arthur » Wed Jul 06, 2011 11:32 pm

Hi, gents

I've estimated a 7 variable SVAR model, and got the contemporaneous relationship A matrix. Then using exactly the same dataset as in Eviews, tried to estimate the same model with Stata. The results were quite different, besides convergence was not achieved. First I thought that the problem was the structure of my A matrix, so I tried a standard Choleski factorization. the results were still different. who knows what's the matter? what is the problem- different optimization algorithms, or perhaps starting values, or something else?

Thanks in advance

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11372
Joined: Tue Sep 16, 2008 5:38 pm

Re: Different results with EViews5 and STATA

Postby EViews Gareth » Thu Jul 07, 2011 7:57 am

If convergence is not achieved, it is hardly surprising that the results are different.
Follow us on Twitter @IHSEViews


Return to “EViews 5 and Earlier”

Who is online

Users browsing this forum: No registered users and 1 guest