On Fri, 24 Mar 2023, Summers, Peter wrote:
Hi all,
I have a feature request for the "summary" command, and a related
documentation issue. Currently the $result accessor isn't produced if
the -by=byvar option is given. How difficult would it be to change that?
Jack> Not very much, I think. And I agree, that would be very nice to have.
Good to hear!
For example could $result be a bundle in that case, with something
like $result.mean giving the means for the various values of byvar?
Jack> For consistency, I'd prefer $result to be a matrix array in that case.
Fetching the required sub-elements would be rather easy by using the
drill() function in the extra addon.
Makes sense. I played around with drill() just now and I agree this would be easy.
Ideally this would also be possible for a list argument, though I
realize that'd be messier - maybe $result[i].mean or something like
that?
Jack> Yes, that'd be a bit messier IMO :D
If you think it'd be messy then I'm scared 😉
In any case, I think the documentation should mention that the
$result
accessor isn't generated with the -by option.
Jack> It should, yes. But if we update "summary" to provide a $result with
the --by option and document that, we'd be ok.
Good point
The context is doing a growth accounting exercise and tabulating
average growth rates by decade. Currently I'm using a loop construct
to build up a table of values. That works fine, but feels a bit brute-force.
Jack> The aggregate() function is quite nice in the respect. Try this:
Very nice indeed; thanks, Jack!
PS
-------------------------------------------------------
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
-------------------------------------------------------