On Mon, 4 Apr 2016, Henrique Andrade wrote:
Dear Gretl Team,
Is it possible to allow the accessors $test and $pvalue after the
correlation (corr) command?
It is important to me because I'm developing some programs that tries to
automatically choose regressors.
How about this?
<hansl>
function matrix hanslcorr (series x, series y)
r = corr(x, y)
n = sum(ok(x) && ok(y))
test = r * sqrt((n-2) / (1 - r*r))
pval = pvalue(t, n-2, test)
return {r, test, pval}
end function
# example usage
open data4-10
corr CATHOL ENROLL
m = hanslcorr(CATHOL, ENROLL)
print m
</hansl>
Allin