Current location - Education and Training Encyclopedia - Graduation thesis - Two problems of random walk pseudo-regression operation in econometric statistics
Two problems of random walk pseudo-regression operation in econometric statistics
Using STATA to generate two random walk time series, and then regressing each other 100 times,

Using the obtained results, we can see the revised determination coefficient and the average value of DW.

At present, I have entered the following command in doedit.

Set obs 1000

Generation time =_n

Tsset time

forvalues i = 1 / `NofLoop' {

Quietly (

Replace wn 1 = rnormal ()

Replace wn2 = rnormal ()

Replace rw 1 = sum(wn 1)

Replace rw2 = sum (wn2)

Regression rw 1 rw2

* t value

Local tvalue = abs(_b[rw2]/_se[rw2])

if `tvalue ' & gt2 {

Local counter = `counter'+1

}

}

}

Displays "important results:" `counter' "NofLoop'.

clear

Set obs 1000

Generation time =_n

gen wn 1 =。

gen wn2 =。

gen rw 1 =。

gen rw2 =。

Tsset time

For the value I =110000 {

Quietly (

Replace wn 1 = rnormal ()

Replace wn2 = rnormal ()

Replace rw 1 = sum(wn 1)

Replace rw2 = sum (wn2)

Regression rw 1 rw2

* t value

Local tvalue = abs(_b[rw2]/_se[rw2])

if `tvalue ' & gt2 {

Local counter = `counter'+1

}

}

}

Display "Important Results:" `Counter' "/" 10000.