Dear Gretl community,

I am working with a panel and I want to get the mean for each unit, but just once. If I use the pmean(x) I get the mean of each unit repeated for each observation in that unit.
Is there any way to get the mean of each unit once?

As an example, I have a variable call Sales, so I use the following:

printf "Proportion of sales (in percentage) %g \n", pmean(sales)*100

But I get repeated the mean of the unit.

As an example, If I have just one unit, that is no panel at all, then mean is a scalar and get printed just once.

Best regards,
Leandro