Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: DW-statistic for the example in Gujarati(2003) p.641


From   "Brian P. Poi" <[email protected]>
To   [email protected]
Subject   Re: st: DW-statistic for the example in Gujarati(2003) p.641
Date   Fri, 9 Dec 2005 10:56:13 -0600 (CST)

On Fri, 9 Dec 2005, Armen Khachatryan wrote:

I hope someone can give me a clue why I fail to get Durbin-Watson statistic
when I replicate the example in Gujarati(2003) p.641 when regressing y on x2
x3 using the famous Grunfeld investment data, and then typing -estat
dwatson-?
The error says -no multiple panels allowed-. Gujarati used Eviews, and I got
the reported d-statistic using Eviews as well.
In addition, I calculated the result step by step in Stata using the formula
for d. I got  exactly what Eviews reported.
By the way, the number for d reported in Gujarati (2003) p. 641 is not
correct all other figures being the same as I get after the OLS in Stata and
Eviews.

My question: why I can't get that statistic in Stata directly? Am I missing
an obvious thing? Thanks in advance.

Armen

The Grunfeld dataset that accompanies Gujarati's text is actually a panel of 4 firms over 20 years. In the example on p. 641 he runs a pooled regression, stacking the data for the four firms on top of each other.

To get Stata to compute the Durbin-Watson statistic, we need to trick it into thinking this is time series data.

Here is how I did that:

insheet using guj.txt // From the CD-ROM accompanying the book
drop v5 v6
rename v2 I
rename v3 lagF
rename v4 lagC
gen year = real(substr(v1, length(v1)-3, .))
gen str company = substr(v1, 2, 2)
sort company year
gen t = _n
tsset t
regress I lagF lagC
estat dwatson

Durbin-Watson d-statistic( 3, 80) = .3097946



I could not replicate Gujarati's reported DW statistic of 0.2187. Carrying out the formula in his text manually, I obtained precisely the same result as reported by -estat dwatson-. Note that the DW statistic depends on the sort order of the data.

Hope this helps

-- Brian Poi
-- [email protected]
*
* 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/




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