[Gretl-users] loop

Remigijus Lapinskas remigijus.lapinskas at mif.vu.lt
Sun Nov 22 06:55:59 EST 2009


Artur and other good people from the list,

This is close to what I want. The only problem is that x takes 90 
values, so I need a loop. I am close to solution, however I hasn't 
caught it yet.

Best, Rem

artur bala wrote:
> 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 at lists.wfu.edu
>>> http://lists.wfu.edu/mailman/listinfo/gretl-users
>>>
>>>
>>>     
>> _______________________________________________
>> Gretl-users mailing list
>> Gretl-users at lists.wfu.edu
>> http://lists.wfu.edu/mailman/listinfo/gretl-users
>>
>>
>>   
> 
> 
> _______________________________________________
> Gretl-users mailing list
> Gretl-users at lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
> 
> 
> 



More information about the Gretl-users mailing list