Hi,
what you ask for is called an aggregation. Gretl has built-in a function
called aggregate. Here is an example on how to execute the aggregate
function as well as how to use the agg() function from the PandasPort
package:
<hansl>
set verbose off
open credscore.gdt
# Group "Income" by binary dummy "Selfempl" and compute the mean
help aggregate # look at the help function
matrix result = aggregate(Income, Selfempl, "mean")
print result
# Make use of the PandasPort package
pkg install PandasPort # must be executed once!
include PandasPort.gfn
# Using the package, you can even compute multiple operations
strings operations = defarray("mean", "median")
matrix result2 = agg(Income, Selfempl, operations)
print result2
</hansl>
Best
Artur
Am 22.05.24 um 23:17 schrieb g s:
> Hi all
>
> I have a report about free to use menu based statistical software.
>
> Free To Use Statistical Software: Comparing Statistical Analyses
>
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4105959
>
> This paper compares some basic analysis (frequencies, means by groups,
> correlations, OLS regression) among the different programs to make sure
> they all have the same results.
>
> I'm looking to add gretl, using the menu version.
>
> I found frequencies. Highlight variable of interest, then Variable and
> then Frequency Distribution.
>
> I'd like to do a means table, means of a continuous variable for each
> category in a categorical variable. I haven't found how to do that yet.
>
>
> I have a csv version of the data set here
>
https://drive.google.com/file/d/11WIET3s4eMHsB6JQ6hOQBx0SKquGRKKw/view?us...
>
> One variable is population, which is population by country. Another
> variable is region, that is, world region. All of the countries are
> included in some region. How do I get mean population by world region?
>
> Thanks
>
> Gene
>
>
>
> _______________________________________________
> Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
> To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
> Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/