Saturday, March 13, 2010

Gretl part2 instant regression with built-in datasets.

Gretl comes with useful datasets and that includes datasets from standard textbooks! So teachers of Econometrics should have a single convenient source of econometrics data for expository purposes.

Let us select the djclose.gdt dataset by clicking on gretl/File/Open data/Sample file... and selecting the djclose (Dow Jones Industrial Average daily close).


Let us add data index variable for the data by clicking on Gretl/Add/Index variable. Gretl will then add the variable index.

Let us view the data. Click on gretl/View/Graph specified vars/X-Y scatter. Select the Index variable for X-axis variable and selcect djclose for Y-axis variable. When you click on the Ok button, the following graph will be displayed.



That is neat! The least squares line is drawn automatically. Right click inside the graph and save it to djclose.png.

Now lets see the standard output of regression of Gretl.
Click on gretl/Model/Ordinary Least Squares and a popup gretl:model 1 window will appear.
Select djclose for dependent variable, constant and index for independent variables and click Ok.
You should get the following output:



Model 1: OLS estimates using the 2528 observations 80/01/02-89/12/29
Dependent variable: djclose

coefficient std. error t-ratio p-value
-------------------------------------------------------
const 554.455 8.47987 65.38 0.0000 ***
index 0.751325 0.00580823 129.4 0.0000 ***

Mean dependent var 1504.506 S.D. dependent var 588.3432
Sum squared resid 1.15e+08 S.E. of regression 213.1174
R-squared 0.868839 Adjusted R-squared 0.868787
F(1, 2526) 16732.79 P-value(F) 0.000000
Log-likelihood −17140.82 Akaike criterion 34285.63
Schwarz criterion 34297.30 Hannan-Quinn 34289.87
rho 0.995548 Durbin-Watson 0.009046




That looks easy to do and it is! Look at the p-values for the const and index variables. This indicates that const and index are significant! Other numeric output measures are shown on the output above but we leave it to future posts to explain further.

We hope that Gretl becomes the standard free software for doing econometrics although this author feels that a Python version would be much more extensible. Gretl will inspire our own future Gui based econometris software written in Python.

No comments:

Post a Comment