On Sat, 6 Apr 2013, Giuseppe Vittucci wrote:
Dear all,
I would like to plot the kernel density estimates of a particular
variable across two different years in the same graph.
Is there a way to do it in gretl?
One of the possible solutions is to use the kdensity() function con
construct a matrix which is then handed to gnuplot. For example:
<hansl>
open australia.gdt
smpl ; 1979:4
d1 = kdensity(IAU)
smpl full
smpl 1980:1 ; --replace
d2 = kdensity(IAU)
# put the two together
d = (d1 ~ NA) | (d2[,1] ~ NA ~ d2[,2])
colnames(d, "x 70s later")
gnuplot 2 3 1 --matrix=d --output=display --with-lines
</hansl>
Of course, this may need some later processing, but you get the idea.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------