Am 05.01.2018 um 16:35 schrieb Riccardo (Jack) Lucchetti:
On Fri, 5 Jan 2018, A. T. wrote:
Hope this helps:
<hansl>
set verbose off
open denmark.gdt -q
series mup = (diff(LRM)>0)
series yup = (diff(LRY)>0)
list L = mup yup
xtab L
matrix A = mxtab(mup, yup)
matrix c = sumr(A)
matrix r = sumc(A)
scalar n = sumc(c)
matrix B = c*r/n
P = (A - B).^2 ./ B
PearChi2 = sumc(vec(P))
</hansl>
This is of course very nice and welcome, but just to be clear, I don't
think Artur was claiming that it's very difficult to calculate the chi2
independence test manually. Just that a slightly extended interface to
the existing gretl routine would be useful.
cheers,
sven