Hi all, I'd been usng Gretl for over 3 years now and I need it to do two
tests: Bartlett's Test and Levene's test for Homogeanity of Variance, to use
them in the residuals of some models. Currently I'm working on Bartlett's
Test function (I'm just beggining to use the function editor in Gretl, be
nice) and I'm stuck here:
function bartlett (series y, series x, int numbin)
#Bartlett's test for Homogeanity of Variances
rango = max(x)-min(x)
binswidth = rango/numbin
printf "Width of Categories = %2.3g\n", binswidth
i=1
maxband = min(x)+i*binswidth
lowband = maxband-binswidth
genr sample = (x<=maxband&x>=lowband)
smpl sample = 1 --restrict
end function
I'm starting to separate the groups, but the genr function is doing nothing.
Could some-one please check what is wrong and give me feed back. I just want
it to generate the sample variable, in order to use it as a restriction to
create a subsample. The i variable is going to be use for a loop so don't
worry about that.
The thing is that when I do the "genr sample =
(POPM<=maxband&POPM>=lowband)" code in Gretl's console it does it
allright
but when I do it as a function "? bartlett(RESID01,POPM,5)" it does nothing,
it only shows the printf output, but it doesn't generates the sample series
and much less changes the sample size of the workfile.
Thanks for your help.
--
Marcos Larios Santa Rosa