Hello everybody,
last year Riccardo Lucchetti helped me with a makeshift violin plot implementation (see
below, where I copied the specific info). After making a lot of graphical analysis for my
PhD I pondered more and more about the "deficit" of boxplots and in that case
violin plots, too, in properly representing multi-modal, skewed, etc., distributions.
After a bit of research I found that bean-plots might be a very good alternative. There is
a (good?) implementation for R. I was wandering, if it was possible to provide a similar
functionality for GRETL and - if possible - based on gnuplot, as this allows easy
fine-tuning if necessary (by saving as .gp or even passing literals via hansl).
Here is a good post on bean-plots and R:
http://www.r-bloggers.com/boxplots-beyond-iv-beanplots/
And some starter for gnuplot:
http://stackoverflow.com/questions/19260578/anyone-have-a-way-to-plot-a-b...
(The option to have three factorsiations by "halfing" the beans in the example
is especially nice, too.)
- Frederik
------------
Frederik Schaff, Dipl.-Volkswirt
University of Hagen
Department of Business and Economics
Chair of Economic Theory (Prof. A. Endres)
Universitätsstraße 11 (TGZ)
58097 Hagen
Phone: +49 (0) 2331 987-4454
E-Mail: Frederik.Schaff(a)FernUni-Hagen.de
http://www.fernuni-hagen.de/wirtschaftstheorie/en/team/frederik.schaff.shtml
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] Im
Auftrag von Riccardo (Jack) Lucchetti
Gesendet: Mittwoch, 21. Oktober 2015 15:06
An: Gretl list
Betreff: Re: [Gretl-users] --output="Icon"?, violin-plot option (request)
On Wed, 21 Oct 2015, Schaff, Frederik wrote:
And a feature request (if I may): It would be "nice to
have" a violin
plot option for the boxplots, like the last one from
http://gnuplot.sourceforge.net/demo_cvs/violinplot.html.
The script below could be perhaps useful as a starting point for a nice function package
(hint, hint)
<hansl>
open mroz87
series lwage = ln(WW)
series lage = ln(WA)
k1 = kdensity(lwage)
x1 = k1[,2]
y1 = k1[,1]
a1 = (NA ~ y1) | (y1 ~ NA)
k2 = kdensity(lage)
x2 = k2[,2]
y2 = k2[,1]
a2 = (NA ~ y2) | (y2 ~ NA)
c = mshape(NA, rows(a1) + rows(a2), 4)
c[1:rows(a1),1:2] = a1
c[rows(a1)+1:,3:] = a2
c2 = (x1 | -x1) | (3 .+ (x2 | -x2))
c = c ~ c2
plot c
option with-lines
literal unset key
literal set linetype 1 lc rgb "#000000"
literal set linetype 2 lc rgb "#000000"
literal set linetype 3 lc rgb "#ff0000"
literal set linetype 4 lc rgb "#ff0000"
literal unset xzeroaxis
end plot --output=display
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------