On 30/04/14 13:32, Riccardo (Jack) Lucchetti wrote:
On Wed, 30 Apr 2014, Ignacio Diaz-Emparanza wrote:
> the last line in this script makes gretl to crash: (gretl from today
> CVS on Ubuntu Linux 12.04)
>
> <hansl>
> nulldata 8
> series vari= { 1; 2; 3; 4; 5; 6; 7; 8}
> series w = { 1; 1; 1; 1; 2; 2; 2; 2 }
> summary vari --weight=w
> </hansl>
Thanks, Ignacio: this is now fixed in CVS.
The crash was related to the fact that, with so few datapoints, the 5%
and 95% percentiles are effectively undefined, and this was unhandled
(my fault). Fun fact: this is one of the few fixes that was physically
coded jointly by Allin and myself, cause we happen to be in the same
room at the moment! :)
Thanks. By the way I prepared a function for doing the same thing by
means of using the --matrix option of 'sumary' and I see there are
several results different: median, 5% and 95% percentiles and
Interquartile range ¿is this correct?
(and note: the option --weight is not explained in the reference for the
suumary command)
<hansl>
function void summaryw(series y, series w)
string cname=argname(y)
matrix mvari = { y }
matrix mw = { w }
matrix A = {}
loop i=1..rows(mvari)
matrix A = A | mshape(mvari[i,1], mw[i,1],1)
endloop
colnames(A, "@cname")
A
summary --matrix=A
end function
/*The table below shows the times taken by a group of walkers to
complete a 15-mile walk. Their times have been recorded to the nearest hour.
Time (hours) 3 4 5 6 7 8
Frequency 2 5 12 11 4 3
*/
nulldata 6
series hours= { 3; 4; 5; 6; 7; 8}
series Freq = { 2; 5; 12; 11; 4; 3 }
summaryw(hours, Freq)
summary hours --weight=Freq
</hansl>
--
Firma Arista
*Ignacio Díaz-Emparanza*
Zuzendaria/Director
ignacio.diaz-emparanza(a)ehu.es <mailto:ignacio.diaz.emparanza@ehu.es>
94 6013732
*EKONOMIA APLIKATUA III SAILA (EKONOMETRIA ETA ESTATISTIKA)/
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU*
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
*T.: +34 946013740* | *F.: +34 946013754*
*www.ea3.ehu.es* <
http://www.ea3.ehu.es>
ERNE! Baliteke mezu honen zatiren bat edo mezu osoa legez babestuta
egotea. Mezuak badu bere hartzailea. Okerreko helbidera heldu bada
(helbidea gaizki idatzi, transmisioak huts egin) eman abisu igorleari,
korreo honi erantzunda. Kontuz! Mezua ez bada zuretzat, ez erabili, ez
zabaldu beste inori, ez kopiatu eta ez baliatu.
¡ATENCIÓN! Este mensaje contiene información privilegiada o confidencial
a la que sólo tiene derecho a acceder el destinatario. Si usted lo
recibe por error le agradeceríamos que no hiciera uso de la información
y que se pusiese en contacto con el remitente.
E-mail hau inprimatu baino lehen egiaztatu inprimatzeko beharra.
Antes de imprimir este e-mail piense bien si es necesario hacerlo.