Blog: Difference between revisions

From GretlWiki
Jump to navigation Jump to search
(Started the page, added "gridplot")
(Start section on gretl 2024a (and add the dark theme announcement to 2023c))
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
A good concise list is provided in the official [https://gretl.sourceforge.net/ChangeLog.html changelog], here the aim is to be more explicit and sometimes give some examples. Before the respective new gretl version is released, the examples will only work in snapshots that are recent enough, or with self-compiled bleeding-edge versions.  
A good concise list is provided in the official [https://gretl.sourceforge.net/ChangeLog.html changelog], here the aim is to be more explicit and sometimes give some examples. Before the respective new gretl version is released, the examples will only work in snapshots that are recent enough, or with self-compiled bleeding-edge versions.  


=== New in what will be gretl 2023c ===
=== New in what will be gretl 2024a ===
(as always, just a selection)
 
==== more flexible ''info'' command ====
 
Not a huge new feature, but the ''info'' command now offers a scripting way to editing the meta data of a dataset. The GUI analog (which has always been possible) is to go to Data / Dataset info.
 
The relevant new options are ''--to-file'' and ''--from-file''.
 
===New in gretl 2023c===
(this is just a selection, not exhaustive)
(this is just a selection, not exhaustive)


==== ''gridplot'' command ====
====''gridplot'' command====
This new native command makes it possible to arrange several subplots in a grid (rectangular) layout. As such it will pretty much replace the contributed function package ''multiplot''. There are basically two ways of using it:
This new native command makes it possible to arrange several subplots in a grid (rectangular) layout. As such it will pretty much replace the contributed function package ''multiplot''. There are basically two ways of using it:


First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:  
First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:  


<code>open australia</code>  
<pre>
open australia
strings temparr = array(2)
qqplot IAU --outbuf=temparr[1]
kdplot E --outbuf=temparr[2]
gridplot temparr --output=display
</pre>


<code>strings temparr = array(2)</code>
Secondly, use the companion command ''gpbuild'' in a block format, and then define the individual parts:


<code>qqplot IAU --outbuf=temparr[1]</code>
<pre>
open data4-10
gpbuild MyPlots
    gnuplot ENROLL CATHOL
    gnuplot ENROLL INCOME
    gnuplot ENROLL COLLEGE
end gpbuild
gridplot MyPlots --output=display
</pre>


<code>kdplot E --outbuf=temparr[2]</code>
====''tsplots'' (virtual) command====
You can now use the new ''tsplots'' command to create several joint time-series plots easily. Example:


<code>gridplot temparr --output=display</code>
<pre>
open denmark
tsplots LRM LRY --output=display
</pre>


Secondly, use the companion command ''gpbuild'' in a block format, and then define the individual parts:
This has actually "always" been possible with the ''scatters'' command --and was duly documented-- but it was somewhat counterintuitive to use a command for scatter plots to draw time-series lines.
 
====plot multiple bands====
Plotting a single band to represent a confidence area or something similar has been possible for a long long time. Now you can also insert more than one band into a plot. The syntax relies on specifying a hansl bundle for each band and then passing all of them inside an array of bundles to the gnuplot call. Meaningless example:
 
<pre>
# create artificial data
nulldata 50
setobs 1 1 --time-series
series y = log(time) # main line to be plotted
series w = normal() # example width series
series x1 = y + 0.1 # optional center different from y
series x2 = y - 0.1 # ditto
 
# specify the band specs
bundle b1 = _(center="x1", width="w", style="bars")
bundle b2 = _(center="x2", width="w", factor=0.2, style="fill", color="grey")
bundles bandspecs = defarray(b1,b2)
 
# execute the plot
gnuplot y --time-series --with-lines --output=display --bands=bandspecs
</pre>
 
====cluster-robust standard errors generalized for panel models====
For the ''panel'' command, the ''--robust'' option has always given you robust standard errors in the sense that clustering by panel units (groups, whatever you want to call them) is done by gretl. Several generalizations are now possible with the ''--cluster'' option; see also ch. 22 of the user guide.


<code>open data4-10</code>
*clustering by time period, example:
<pre>
open abdata
panel WAGE const INDOUTPT --cluster=$time
</pre>


<code>gpbuild MyPlots</code>
*clustering by a user-defined variable, example:
<pre>
open abdata
panel WAGE const INDOUTPT --cluster=IND
</pre>


<code> gnuplot ENROLL CATHOL</code>
* two-way clustering, example:
<pre>
open abdata
panel WAGE const INDOUTPT --cluster=$time,IND
</pre>
(If you want to combine clustering by panel units/groups with another variable, you can use the keyword <code>$unit</code> just like <code>$time</code>.)


<code> gnuplot ENROLL INCOME</code>
Please also check out the ''--no-df-corr'' option if you want to compare results with other software.


<code> gnuplot ENROLL COLLEGE</code>
*Driscoll-Kraay robust standard errors, example:
<pre>
open abdata
set panel_robust scc # scc: spatial-correlation consistent
panel WAGE const INDOUTPT --robust
</pre>
Driscoll-Kraay standard errors have also been available in the contributed package ''CSDpanel'', now they are natively implemented. This is not the same as two-way clustering, but they are related. This is also available in the GUI by selecting the corresponding SCC option for the robust variance estimation. For scripting, the ''hac_lag'' setting is also relevant. See section 22.4. of the guide.


<code>end gpbuild</code>
====panel data handling: convert side-by-side time series in the GUI====
This is not so easy to explain, but suppose you have a variable 'GDP' as several time series for several countries, say for France and the US. Then you want to convert this from a time-series dataset to a panel dataset with a single series spanning the two units (countries). This has always been possible with scripting, see section 4.5 of the user guide. Now you can also do it in the menu GUI interface.
[[File:Panel dataset structure dialog.png|left|thumb]]


<code>gridplot MyPlots --output=display</code>
====dark theme on Windows and MacOS====
An experimental dark theme option is now available on non-Linux systems.

Latest revision as of 10:11, 16 January 2024

New features, fixed bugs, and software news are shown here

A good concise list is provided in the official changelog, here the aim is to be more explicit and sometimes give some examples. Before the respective new gretl version is released, the examples will only work in snapshots that are recent enough, or with self-compiled bleeding-edge versions.

New in what will be gretl 2024a

(as always, just a selection)

more flexible info command

Not a huge new feature, but the info command now offers a scripting way to editing the meta data of a dataset. The GUI analog (which has always been possible) is to go to Data / Dataset info.

The relevant new options are --to-file and --from-file.

New in gretl 2023c

(this is just a selection, not exhaustive)

gridplot command

This new native command makes it possible to arrange several subplots in a grid (rectangular) layout. As such it will pretty much replace the contributed function package multiplot. There are basically two ways of using it:

First, using some other plotting commands, redirect the output to a string buffer inside a strings array. Then execute the gridplot command on that array. Example:

open australia
strings temparr = array(2)
qqplot IAU --outbuf=temparr[1]
kdplot E --outbuf=temparr[2]
gridplot temparr --output=display

Secondly, use the companion command gpbuild in a block format, and then define the individual parts:

open data4-10
gpbuild MyPlots
    gnuplot ENROLL CATHOL
    gnuplot ENROLL INCOME
    gnuplot ENROLL COLLEGE
end gpbuild
gridplot MyPlots --output=display

tsplots (virtual) command

You can now use the new tsplots command to create several joint time-series plots easily. Example:

open denmark
tsplots LRM LRY --output=display

This has actually "always" been possible with the scatters command --and was duly documented-- but it was somewhat counterintuitive to use a command for scatter plots to draw time-series lines.

plot multiple bands

Plotting a single band to represent a confidence area or something similar has been possible for a long long time. Now you can also insert more than one band into a plot. The syntax relies on specifying a hansl bundle for each band and then passing all of them inside an array of bundles to the gnuplot call. Meaningless example:

# create artificial data 
nulldata 50
setobs 1 1 --time-series 
series y = log(time)	# main line to be plotted
series w = normal()	# example width series 
series x1 = y + 0.1 	# optional center different from y
series x2 = y - 0.1	# ditto

# specify the band specs 
bundle b1 = _(center="x1", width="w", style="bars") 
bundle b2 = _(center="x2", width="w", factor=0.2, style="fill", color="grey")
bundles bandspecs = defarray(b1,b2)

# execute the plot 
gnuplot y --time-series --with-lines --output=display --bands=bandspecs 

cluster-robust standard errors generalized for panel models

For the panel command, the --robust option has always given you robust standard errors in the sense that clustering by panel units (groups, whatever you want to call them) is done by gretl. Several generalizations are now possible with the --cluster option; see also ch. 22 of the user guide.

  • clustering by time period, example:
open abdata
panel WAGE const INDOUTPT --cluster=$time
  • clustering by a user-defined variable, example:
open abdata
panel WAGE const INDOUTPT --cluster=IND
  • two-way clustering, example:
open abdata
panel WAGE const INDOUTPT --cluster=$time,IND

(If you want to combine clustering by panel units/groups with another variable, you can use the keyword $unit just like $time.)

Please also check out the --no-df-corr option if you want to compare results with other software.

  • Driscoll-Kraay robust standard errors, example:
open abdata
set panel_robust scc # scc: spatial-correlation consistent
panel WAGE const INDOUTPT --robust

Driscoll-Kraay standard errors have also been available in the contributed package CSDpanel, now they are natively implemented. This is not the same as two-way clustering, but they are related. This is also available in the GUI by selecting the corresponding SCC option for the robust variance estimation. For scripting, the hac_lag setting is also relevant. See section 22.4. of the guide.

panel data handling: convert side-by-side time series in the GUI

This is not so easy to explain, but suppose you have a variable 'GDP' as several time series for several countries, say for France and the US. Then you want to convert this from a time-series dataset to a panel dataset with a single series spanning the two units (countries). This has always been possible with scripting, see section 4.5 of the user guide. Now you can also do it in the menu GUI interface.

dark theme on Windows and MacOS

An experimental dark theme option is now available on non-Linux systems.