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

st: AW: d-w stat in gujararti


From   "Armen Khachatryan" <[email protected]>
To   <[email protected]>
Subject   st: AW: d-w stat in gujararti
Date   Sat, 10 Dec 2005 12:33:59 +0100

Dear Kit and Brian,

Thanks a lot for clear instructions. I am now a small step further in my
learning and understanding of panel analysis in Stata.




Armen 

-----Urspr�ngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Christopher
Baum
Gesendet: Freitag, 9. Dezember 2005 21:08
An: [email protected]
Betreff: st: d-w stat in gujararti

Brian's solution:

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




fails to take into account the gaps in the data. You should not be taking
the differences between different firms' errors! The enclosed does not match
Gujarati exactly, but it comes close:

webuse grunfeld,clear
keep if company<4 | company == 8
set obs 81
replace company = 2 in 81
replace year = 1934 in 81
set obs 82
replace company = 3 in 82
replace year = 1934 in 82
set obs 83
replace company = 8 in 83
replace year = 1934 in 83
sort company year
gen t=_n
tsset t
l
regress invest mvalue kstock
dwstat


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
*
*   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/

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09.12.2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09.12.2005
 


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