Hi,
regarding grouped summary statistics, see the built-in gretl function `aggregate()`:
https://gretl.sourceforge.net/gretl-help/funcref.html#aggregate
For computing multiple grouped statistics, see also the PandasPort package:
https://gretl.sourceforge.net/current_fnfiles/PandasPort.gfn
Example
```
set verbose off
### Use bult-in aggregate() function
matrix mout_mean = aggregate(Targets, Groupby, "mean")
print mout_mean
matrix mout_median = aggregate(Targets, Groupby, "median")
print mout_median
### USE PandasPort package
# pkg install PandasPort # ONLY ONCE NEEDED FOR PACKAGE INSTALLTION
include PandasPort.gfn
open mrw.gdt --quiet
# Aggregation for multiple methods
strings methods = defarray("mean", "min", "max")
# Groupy by single discrete series
matrix result = agg(gdp85, OECD, methods)
print result
# Groupy by multiple discrete series
list Targets = gdp60 gdp85
list Groupby = nonoil OECD
matrix result = agg(Targets, Groupby, methods)
print result
```
For regression this does not exist in gretl yet. Most simple solution I can imagine: Run a
loop over the grouping variable and restrict the sample each iteration before running a
regression.
Artur