It's been tested against the Hansen code. There are issues with exactly replicating the results, but you can get close. I'll have to explain in some depth.
The biggest issue is in the specification for the deterministics in the regressor relationship (k1 and k2). In the description of the estimation, Hansen says that he is going to estimate a model that has a constant and a time trend in the equation. He is silent about the specification of the deterministics (k1 and k2) in the regressor equation, but the implication is that k1 has a constant and time trend and that k2 is null.
The actual Hansen code for computing the residuals in the x_2t equations (the u_2t) first differences the x_2t variables, and then obtains the residuals from a regression on a constant and a trend variable. The problem with this is that it is implicitly adding a higher order deterministic to the specification of the x_2t. After differencing, the presence of a constant and trend in x_2t would only involve demeaning the differenced data. I don't think this is what he wanted to do. I think he wanted to demean only. If you want to include the trend, you either obtain the residuals from the trend regression, or difference and obtain the residuals from the constant regression. You shouldn't do both the differencing and the trend regression.
At this point the basic EViews model which involves a trend in both equations would (and does) differ in all calculations.
Now you can get *close* to the Hansen code by adding a quadratic trend to the regressors specification in EViews. If you then use the "Estimate using differenced data" option in EViews you'll get a calculation that is close to Hansen's (since the difference of the quadratic terms is a modified linear trend). [edit] Note however, that Hansen estimates the residuals from the long-run equation slightly differently from EViews; he uses the sample that drops the first observation while EViews uses the full sample, therefore the residuals for the long-run regression are slightly different. Hence the remaining calculations differ slightly. But only slightly.
For example, for the first TC on DI equation, you can get close by estimating
Code: Select all
equation eqfmols.COINTREG(TREND=LINEAR,REGTREND=QUADRATIC,REGDIFF,LAG=1,KERN=QUADSPEC,BW=ANDREWS) TC DI
The results are close. The coefficient on DI using EViews with these settings is .9816 with an error of 0.089, versus .9836 and an error of .08788 in the Hansen Gauss output. As you might expect the trend and intercepts are off by a bit more than this, but they're in the ballpark.
As to the differences in the Lc results that began this discussion, the Hansen result is 0.50879397 with a p-value of 0.093352494. The EViews results with these settings is 0.505358 with a p-value of 0.1300. Which is close, but again, not quite. A comment on the p-value. The problem with getting the Hansen result by adding the quadratic deterministic trend to the regressor equations in EViews is that it modifies the asymptotic statistics so that we are assuming a different asymptotic distribution than does Hansen. So while the statistics are close, the p-values will differ because of the differing assumption.