Dear Trubador,

Thank you very much for the revision code and you are really smart. The code is running well now.. Is it plausible to let me know your full name as I would like to acknowledge you when I am using the codes for my research.

Thank you,

Regards,

tcfoon

## Lumsdaine-Papell Unit Root Test

**Moderators:** EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

### Re: Lumsdaine-Papell Unit Root Test

Last edited by tcfoon on Tue Sep 28, 2010 2:55 am, edited 1 time in total.

### Re: Lumsdaine-Papell Unit Root Test

Hi guys, I'm new in this forum. I have some problem with running the Zivot-Andrews in the code published by trubador on Jun 01 2009 (that is, the last one code which appears in this discussion). I create a group of variables and then, when I run the model, appears the following script: "Syntax error in for !kk = 1 to g.@count".

I describe my estimation problem. I want to run the Zivot-Andrews test for the following variables: pce (the dependent variable), fedf_n, ylyt, stnw, nstnw (all in log form excluding fedf_n). I run the code of trubadr, but it appears the above message of error ( "Syntax error in for !kk = 1 to g.@count"). Anyone can help me, please? Thanks ina advance.

Hi,

Davide

I describe my estimation problem. I want to run the Zivot-Andrews test for the following variables: pce (the dependent variable), fedf_n, ylyt, stnw, nstnw (all in log form excluding fedf_n). I run the code of trubadr, but it appears the above message of error ( "Syntax error in for !kk = 1 to g.@count"). Anyone can help me, please? Thanks ina advance.

Hi,

Davide

### Re: Lumsdaine-Papell Unit Root Test

EViews codes regarding the Zivot-Andrews unit root rest under this thread are not fully functional and do not produce the desired results. Please use the following (accurate and more complete) version of the code: Zivot-Andrews Unit Root Test

### Re: Lumsdaine-Papell Unit Root Test

Following up on this very helpful exchange:

Would either of you have written a code for the Clemente-Montanes-Reyes unit root test, which also alows for two structural breaks (it is implemented in Stata as "clemao" or "clemio", depending on form)?

Many thanks

Regards

Donihue

Would either of you have written a code for the Clemente-Montanes-Reyes unit root test, which also alows for two structural breaks (it is implemented in Stata as "clemao" or "clemio", depending on form)?

Many thanks

Regards

Donihue

### Re: Lumsdaine-Papell Unit Root Test

Dear expert:

Could you tell me how to compute critcial valure of LP test

Thanks!

Could you tell me how to compute critcial valure of LP test

Thanks!

tcfoon wrote:Dear Trubador,

Thank you very much for the coding. I am really appreciate your help..

Warmest regards,

CF Tang

### Re: Lumsdaine-Papell Unit Root Test

Dear Trubador

Could you tell me how to compute critcal value of LP test.

Best Regards

cass

joe xu

joe_3xu(at)sina.com

[quote="trubador"]I have modified your code and added a simulation exercise into the beginning. Although the following code seems to be working and identifying the structural breaks correctly, you can make all the necessary modifications and revisions for more efficient and accurate use.

Could you tell me how to compute critcal value of LP test.

Best Regards

cass

joe xu

joe_3xu(at)sina.com

[quote="trubador"]I have modified your code and added a simulation exercise into the beginning. Although the following code seems to be working and identifying the structural breaks correctly, you can make all the necessary modifications and revisions for more efficient and accurate use.

Code: Select all

`'Simulate a series that has two level shifts`

!N=10000

workfile rollingdfvalue u 1 !N

series adf

wfcreate u 100

!b1=17 'First break

!b2=45 'Second break

smpl @first !b1-1

series sy=@trend + 10*nrnd

smpl !b1 !b2-1

sy = 5*@trend + 20*nrnd

smpl !b2 @last

sy = 7*@trend + 30*nrnd

'Apply Lumsdaine-Papell unit-root test

smpl @all

!trim = 0.1 'Trimming parameter

!t_min = 1000

vector(2) breaks

for !i = @round(@obs(sy)*!trim) to @round(@obs(sy)*(1-!trim))

for !k = !i+2 to @round(@obs(sy)*(1-!trim))-2

series DSY = D(SY)

equation temp.ls DSY c SY(-1) (@trend>!i) (@trend>!i)*(@trend-!i) (@trend>!k) (@trend>!k)*(@trend-!k) DSY(-1 TO -2)

if temp.@tstats(2) < !t_min then

!t_min = temp.@tstats(2)

breaks(1) = !i+2 'Identified first break point.

breaks(2) = !k+2 'Identified second break point

series DU1 = @trend> !i

series DT1 = DU1*(@trend-!i)

series DU2 = @trend>!k

series DT2 = DU2*(@trend-!k)

equation LPA.ls DSY c SY(-1) DU1 DT1 DU2 DT2 DSY(-1 TO -2) 'Selected equation

endif

adf(!i)=LPA.@stats(1)

next

show adf.hist

matrix(2,3)cvalue

cvalue.fill(b=r)0.01,0.05,0.10

!k=1

for %1 0.01 0.05 .0.10

cvalue(2,!k)=@quantile(adf,%1)

!k=!k+1

next

show cvalue

Last edited by xuehe on Tue Jan 12, 2010 11:59 pm, edited 2 times in total.

### Re: Lumsdaine-Papell Unit Root Test

Please help set a monte carlo simulation to compute cretical value of lp test.

trubador wrote:I have modified your code and added a simulation exercise into the beginning. Although the following code seems to be working and identifying the structural breaks correctly, you can make all the necessary modifications and revisions for more efficient and accurate use.Code: Select all

`'Simulate a series that has two level shifts`

wfcreate u 100

!b1=17 'First break

!b2=45 'Second break

smpl @first !b1-1

series sy=@trend + 10*nrnd

smpl !b1 !b2-1

sy = 5*@trend + 20*nrnd

smpl !b2 @last

sy = 7*@trend + 30*nrnd

'Apply Lumsdaine-Papell unit-root test

smpl @all

!trim = 0.1 'Trimming parameter

!t_min = 1000

vector(2) breaks

for !i = @round(@obs(sy)*!trim) to @round(@obs(sy)*(1-!trim))

for !k = !i+2 to @round(@obs(sy)*(1-!trim))-2

series DSY = D(SY)

equation temp.ls DSY c SY(-1) (@trend>!i) (@trend>!i)*(@trend-!i) (@trend>!k) (@trend>!k)*(@trend-!k) DSY(-1 TO -2)

if temp.@tstats(2) < !t_min then

!t_min = temp.@tstats(2)

breaks(1) = !i+2 'Identified first break point.

breaks(2) = !k+2 'Identified second break point

series DU1 = @trend> !i

series DT1 = DU1*(@trend-!i)

series DU2 = @trend>!k

series DT2 = DU2*(@trend-!k)

equation LPA.ls DSY c SY(-1) DU1 DT1 DU2 DT2 DSY(-1 TO -2) 'Selected equation

endif

next

next

delete temp

### Re: Lumsdaine-Papell Unit Root Test

Hi, I've been following the thread on the Lumsdaine-Papell URT. I must admit that you guys are far beyond of what I could ever dream to do in Eviews. I tried to use the code posted here (and its several modifications) but I always get the same error when estimating the temporary regression:

equation temp.ls DY y(-1) C @trend (@trend>!i-2) (@trend>!i-2)*(@trend-!i+2) DY(-1 to -!best_lag)

I get near singular matrix...

Y in my case is the public debt as a share of GDP of a country. The numbers are not weird, so I actually do not know what could be not working.

I appreciate any advice on this.

Regards,

Federico.

equation temp.ls DY y(-1) C @trend (@trend>!i-2) (@trend>!i-2)*(@trend-!i+2) DY(-1 to -!best_lag)

I get near singular matrix...

Y in my case is the public debt as a share of GDP of a country. The numbers are not weird, so I actually do not know what could be not working.

I appreciate any advice on this.

Regards,

Federico.

### Re: Lumsdaine-Papell Unit Root Test

Hi,

if i want to run the lumsdaine-papell unit root test without the simulation, which code may i use?

Thank you

if i want to run the lumsdaine-papell unit root test without the simulation, which code may i use?

Thank you

### Who is online

Users browsing this forum: No registered users and 37 guests