Hi Leandro,
You can try the following script:

open "C:\Program Files\gretl\data\misc\abdata.gdt"
# use of pmean through all observations
genr x1 = pmean(WAGE)
# restrict sample for unit 1; use --balanced flag to save panel structure
smpl unit=1 --restrict --balanced
# compute the mean of WAGE for unit 1
printf "Proportion of sales (in percentage) %g \n", mean(WAGE)
# restore the full sample
smpl --full


-- 
**********************************
Artur BALA
development economist, consultant

phone:	+216 22 99 73 44
skype:	artur.bala.tn
**********************************


Le 08/03/2011 03:50, Leandro Zipitria a écrit :
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
_______________________________________________ Gretl-users mailing list Gretl-users@lists.wfu.edu http://lists.wfu.edu/mailman/listinfo/gretl-users