On Fri, 5 Jan 2018, A. T. wrote:
Dear all,
for an update and simplification of the FEP package I would to replace a
user-own function by xtab. However, xtab lacks currently a few features
for using it within a function:
1) accessor for p-values and test-statistics; in my case, for instance,
I just need information about Pearson's chi^2-test.
2) --silent option
Is there a way to access these statistics somehow?
Here is an illustration:
<hansl>
set verbose off
open denmark.gdt -q
series mup = (diff(LRM)>0)
series yup = (diff(LRY)>0)
list L = mup yup
xtab L
eval $pvalue
eval $test
</hansl>
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>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------