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

st: Re: KPSS test in STATA


From   Kit Baum <baum@bc.edu>
To   jp870@columbia.edu
Subject   st: Re: KPSS test in STATA
Date   Mon, 11 Apr 2005 09:00:08 -0400

Dear Jee-Kwang

The kpss command returns the statistics as individual scalars, not as a matrix:

. webuse wpi1

. whelp kpss

. kpss wpi

KPSS test for wpi

Maxlag = 4 chosen by Schwert criterion
Autocovariances weighted by Bartlett kernel

Critical values for H0: wpi is trend stationary

10%: 0.119 5% : 0.146 2.5%: 0.176 1% : 0.216

Lag order Test statistic
0 1.96
1 .992
2 .669
3 .507
4 .411

. return list

scalars:
r(kpss4) = .4109284269005028
r(kpss3) = .5073039368808655
r(kpss2) = .6685610195922723
r(kpss1) = .9915345342595147
r(kpss0) = 1.958072535544316
r(N) = 124

.
If you specify the maxlag option, you will know how many of these there are. If you want to put them into a matrix, it is easy enough to do so:


. mat kpres = J(5,1,0)

. forv i=1/5 {
2. mat kpres[`i',1] = `r(kpss`=`i'-1')'
3. }

. mat list kpres

kpres[5,1]
c1
r1 1.9580725
r2 .99153453
r3 .66856102
r4 .50730394
r5 .41092843


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

On Apr 11, 2005, at 12:02 AM, jp870@columbia.edu wrote:


Dear Professor Baum,

I am using your KPSS test command. Thanks for contributing the
command to STATA community.
I have a question in getting t-statistics after running the KPSS
test.
The "dfgls" command save the results as "r(results)" so that I can
store it as a matrix of a new name.
How can I get the results(test-statistics) matrix after KPSS?
I will appreciate your response deeply.

Bests

Jee-Kwang Park
Department of Political Science
Columbia University
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index