A more efficient way to use REPORT?

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
alexecon
Posts: 72
Joined: Fri Oct 30, 2015 12:16 pm

A more efficient way to use REPORT?

Unread post by alexecon »

The following does what I want but, given my limited skills in RATS language, I suspect there may be a more efficient way in producing the unit root results table. Any suggestions appreciated.

Code: Select all

*
*******************
* UNIT ROOT TESTS *
*******************
*
* No breaks (Schmidt-Phillips, 1992)
*
@LSUNIT(BREAKS=0,METHOD=GTOS,lags=3) ers3
compute a = %cdstat
@LSUNIT(BREAKS=0,METHOD=GTOS,lags=3) mi3
compute b = %cdstat
@LSUNIT(BREAKS=0,METHOD=GTOS,lags=3) fi3
compute c = %cdstat
*
* One break (Lee and Strazicich, RES 2003)
*
@LSUNIT(BREAKS=1,MODEL=crash,METHOD=GTOS,lags=3) ers3
compute d = %cdstat
@LSUNIT(BREAKS=1,MODEL=BREAK,METHOD=GTOS,lags=3) ers3
compute e = %cdstat
@LSUNIT(BREAKS=1,MODEL=crash,METHOD=GTOS,lags=3) mi3
compute f = %cdstat
@LSUNIT(BREAKS=1,MODEL=BREAK,METHOD=GTOS,lags=3) mi3
compute g = %cdstat
@LSUNIT(BREAKS=1,MODEL=crash,METHOD=GTOS,lags=3) fi3
compute h = %cdstat
@LSUNIT(BREAKS=1,MODEL=BREAK,METHOD=GTOS,lags=3) fi3
compute aa = %cdstat
*
* With 1 break, the LM test critical values are
* -4.239, -3.566 and -3.211 for the "Crash Model".
* For the "Break Model" critical values depend on break location.
* E.g. for a break in the middle of the sample, the crit values are
* -5.11, -4.51, and -4.17 at the 1%, 5%, and 10% significance levels
* (Lee and Strazicich, WP 2004)
* See http://econ.appstate.edu/RePEc/pdf/wp0417.pdf
*
* Two breaks (Lee and Strazicich, RES 2003)
*
@LSUNIT(MODEL=crash,BREAKS=2,METHOD=GTOS,lags=3) ers3
compute k = %cdstat
@LSUNIT(MODEL=BREAK,BREAKS=2,METHOD=GTOS,lags=3) ers3
compute l = %cdstat
@LSUNIT(MODEL=crash,BREAKS=2,METHOD=GTOS,lags=3) mi3
compute m = %cdstat
@LSUNIT(MODEL=BREAK,BREAKS=2,METHOD=GTOS,lags=3) mi3
compute n = %cdstat
@LSUNIT(MODEL=crash,BREAKS=2,METHOD=GTOS,lags=3) fi3
compute o = %cdstat
@LSUNIT(MODEL=BREAK,BREAKS=2,METHOD=GTOS,lags=3) fi3
compute p = %cdstat
*
* With 2 breaks, the LM test critical values are
* -4.545, -3.842, and -3.504 for the "Crash Model", and
* -5.823, -5.286, and -4.989 for the "Break Model"
* at the 1%, 5%, and 10% significance levels
* (Lee and Strazicich, RES 2003)
*
report(action=define,hlabels=||"Test","ers3","mi3","fi3"||)
report(action=modify,atcol=1) "Schmidt-Phillips (1992)" a b c
report(action=format,picture="*.###")
report(action=modify,atcol=1) "Lee-Strazicich (2004), Crash" d f h
report(action=format,picture="*.###")
report(action=modify,atcol=1) "Lee-Strazicich (2004), Break" e g aa
report(action=format,picture="*.###")
report(action=modify,atcol=1) "Lee-Strazicich (2003), Crash" k m o
report(action=format,picture="*.###")
report(action=modify,atcol=1) "Lee-Strazicich (2003), Break" l n p
report(action=format,picture="*.###")
report(action=show, window="Unit Root Tests")
*
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: A more efficient way to use REPORT?

Unread post by TomDoan »

That's probably as good as any, though
  1. You want to add ROW=NEW to REPORT(ACTION=MODIFY,...) (and ACTION=MODIFY is the default, so you don't even need to include that option on those instructions)
  2. You can wait to do just one ACTION=FORMAT at the end. By default, it applies to all numerical fields in the entire report.
Post Reply