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?
Not very much, I think. And I agree, that would be very nice to have.
For example could $result be a bundle in that case, with something
like
$result.mean giving the means for the various values of byvar?
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.
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?
Yes, that'd be a bit messier IMO :D
In any case, I think the documentation should mention that the
$result
accessor isn't generated with the -by option.
It should, yes. But if we update "summary" to provide a $result with the
--by option and document that, we'd be ok.
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.
The aggregate() function is quite nice in the respect. Try this:
<hansl>
open AWM17 --quiet
list X = YER PCR GCR
list G = ldiff(X)
series decade = ceil(($obsmajor-1969)/10)
eval aggregate(G, decade, mean)
</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
-------------------------------------------------------