the following script may fit pretty better as the result will be a vector containing the grouped means only

meanvector = zeros(3,1)
loop i=0..2
    smpl x = i --restrict --replace
    meanvector[i+1,1]=mean(y)
endloop
meanvector

Artur

artur bala a écrit :
Hi Rem,
That's a grouped mean that you need I guess. Try this:

    smpl x=0 --restrict
        summary y
    smpl x=1 --restrict --replace
        summary y
    smpl x=2 --restrict --replace
        summary y
    smpl x=3 --restrict --replace
        summary y

artur

Remigijus Lapinskas a écrit :
  
Sven,

Thank you for your swift replay, but this not exactly what I want. In my 
case I want to get a vector (2.1+3.4)/2, (5.0+1.1+2.2)/3, 3.2/1, 
(1.2+8.8)/2 etc

Cheers,
Rem


Sven Schreiber wrote:
  
    
Remigijus Lapinskas schrieb:
    
      
Dear all,

I have two columns (irregular frequences):

x y

0 2.1
0 3.4

1 5.0
1 1.1
1 2.2

2 3.2

3 1.2
3 8.8


I want to average y's in the first group (x=0), then second(x=1) etc How 
can I do this?

      
        
matrix X = {x, y} # if x, y are series
matrix myaverages = meanc(X)

cheers,
sven
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users


    
      
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users


  
    


_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users