How can i run the "Hatemi-J Cointegration test" code with a .txt data file ?

I have the program code of this test:

http://fmwww.bc.edu/repec/bocode/c/CItest2b.prg

And a .txt file with time- series data included 1 dependable variable and 4 independable variables.

I'm just a new user of GAUSS. Can you give me the steps to do this ? Thanks very much

 

8 Answers



0



The first step in running this code is changing the first line of the program:

load z[obs,var] =b22.txt;

to work for your data file. For testing purposes, you can download a data text file called test_data. This file has 10 rows and 4 columns. You can load it into a variable z in GAUSS like this:

load z[10,4] =test_data.txt;

Now after running this line, you can print z using the print command like this:

print z;

This will confirm that you have loaded it correctly. Then (assuming you want to use the test_data.txt file) you can change the first few lines of the file you linked to, to this:

obs = 10;
var = 4;
load z[obs,var]=test_data.txt;

//Assign the first column of 'z' to 'y'
y = z[1:obs,1];

//Assign the second, third and fourth
//columns of 'z' to 'x'
x = z[1:obs,2:var];

call main(y,x,4,2,12);
end;

You said you are new to GAUSS, so if you need more detailed explanation of what is going on here or run into any trouble, please post your questions! We are happy to help.

aptech

1,773


0



Thanks very much. But how can i load a data file into the code ? I don't know how to do this so i receive:  "(0) : error G0014 : '' : File not found"

 



0



Take a look at this post here. Does that resolve your problem?

aptech

1,773


0



i follow your guide with  the test_data file but i receive:

(0) : error G0121 : Matrix not positive definite
Currently active call: estimate
Stack trace:
estimate
adf
main

What's happen ?  Could you give me an exactly code to run this test succesfully ?

Thanks for your help



0



Try this data file example_data_ci.txt. Change this line:

load z[obs,var] =b22.txt;

to these three lines:

obs = 100;
var = 9;

load z[obs,var] =example_data_ci.txt;

This should work. Make sure that the file example_data_ci.txt is in your GAUSS current working directory.

aptech

1,773


0



I have a little differen problem.

Although i have completed all steps as you wrote, it gives me G0025: Undefined symbol: 'main'

Please help me to fix the problem.

 

Thank you



0



In this case, main is a GAUSS procedure that you may not have the code for, or you have not let GAUSS know where it is. Here is a link to read more about the Undefined symbol error.

However, you should use the TSPDLIB package to run the Hatemi-J test. These YouTube videos show how to run other tests from the TSPDLIB library and running the Hatemi-J test will be very, very similar:

aptech

1,773


0



I use GAUSS 21 Light and I cannot fınd the TSPDLIB package. Does this package not include for this version of GAUSS?

 

Thnak you for your help.

Your Answer

8 Answers

0

The first step in running this code is changing the first line of the program:

load z[obs,var] =b22.txt;

to work for your data file. For testing purposes, you can download a data text file called test_data. This file has 10 rows and 4 columns. You can load it into a variable z in GAUSS like this:

load z[10,4] =test_data.txt;

Now after running this line, you can print z using the print command like this:

print z;

This will confirm that you have loaded it correctly. Then (assuming you want to use the test_data.txt file) you can change the first few lines of the file you linked to, to this:

obs = 10;
var = 4;
load z[obs,var]=test_data.txt;

//Assign the first column of 'z' to 'y'
y = z[1:obs,1];

//Assign the second, third and fourth
//columns of 'z' to 'x'
x = z[1:obs,2:var];

call main(y,x,4,2,12);
end;

You said you are new to GAUSS, so if you need more detailed explanation of what is going on here or run into any trouble, please post your questions! We are happy to help.

0

Thanks very much. But how can i load a data file into the code ? I don't know how to do this so i receive:  "(0) : error G0014 : '' : File not found"

 

0

Take a look at this post here. Does that resolve your problem?

0

i follow your guide with  the test_data file but i receive:

(0) : error G0121 : Matrix not positive definite
Currently active call: estimate
Stack trace:
estimate
adf
main

What's happen ?  Could you give me an exactly code to run this test succesfully ?

Thanks for your help

0

Try this data file example_data_ci.txt. Change this line:

load z[obs,var] =b22.txt;

to these three lines:

obs = 100;
var = 9;

load z[obs,var] =example_data_ci.txt;

This should work. Make sure that the file example_data_ci.txt is in your GAUSS current working directory.

0

I have a little differen problem.

Although i have completed all steps as you wrote, it gives me G0025: Undefined symbol: 'main'

Please help me to fix the problem.

 

Thank you

0

In this case, main is a GAUSS procedure that you may not have the code for, or you have not let GAUSS know where it is. Here is a link to read more about the Undefined symbol error.

However, you should use the TSPDLIB package to run the Hatemi-J test. These YouTube videos show how to run other tests from the TSPDLIB library and running the Hatemi-J test will be very, very similar:

0

I use GAUSS 21 Light and I cannot fınd the TSPDLIB package. Does this package not include for this version of GAUSS?

 

Thnak you for your help.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy