Am 17.06.2024 um 14:03 schrieb Riccardo (Jack) Lucchetti:
On 17/06/2024 12:54, Sven Schreiber wrote:
> But still a histogram certainly has its role. The doc for the
> relevant 'freq' command mentions that the numerical histogram can be
> accessed via $result. I guess that can be used (in a loop) to
> construct the needed plot with your gnuplot magic. Right now I don't
> have time to look into this further.
Up to a point, I'm afraid: the $result for continuous data gives you
the midpoint, but not the boundaries of the bin. And these can be
different from variable to variable, so that'd be tricky.
Yes; however, you can set a uniform pattern with --min=... and
--bindwidth=....
I'd argue that if you want a histogram and not a smoothed density, then
it makes sense to use the same bins when you plan to plot them together.
The first plot example with R in the link given by Chris also does this,
I think. Of course, you still need an algorithm to set a sensible min
and width value.
> (Apart from the other thing that is mentioned in the freq doc, namely
> that the aggregate() function can be used. That's certainly true, but
> it doesn't give an example of how exactly. A challenge for you!?)
open mroz87.gdt
eval aggregate(const, WE)
Well, this is again a discrete frequency distribution, not a histogram.
Maybe the freq help implicitly only has the discrete case in mind.
thanks
sven