Posted by
Margaret MacDougall on
Sep 06, 2006; 8:47am
URL: http://spssx-discussion.165.s1.nabble.com/Query-re-authenticity-of-p-values-for-chi-square-goodness-of-fit-test-tp1070734p1070738.html
Dear Marta
Many thanks for the clarifications and additional information provided. This has been most helpful.
Best wishes
Margaret
Marta García-Granero <
[hidden email]> wrote:
Hi again Margaret
Tuesday, September 5, 2006, 6:56:45 PM, You wrote:
MM> Dear Dominic
MM> Thank you for your kind reply. However, I do not wish to
MM> collapse categories and I am already assuming a multnomial
MM> distribution.
Yes, but you are testing your hypothesis using an asymptotic statistic
(chi-square), valid only if Exp GE 5. What Dominic suggested is that
you compute the exact p-value using the multinomial distribution
(that's what the EXACT TESTS SPSS module does).
MM> What I really need to know is whether it is sound to use the
MM> chi-square goodness-of-fit test when the expected count is less
MM> than 5 and indeed why SPSS chooses to specifically flag the result
MM> that the expected count is less than 5 when there does not appear
MM> to be an alternative test for the one-dimensional case to which
MM> one can resort in such cases.
Apart from the above mentioned exact test, I think that likelihood
ratio test (also called G-tests) is a bit more robust than Pearson's
chi-square statistic (mainly when this condition happens: |Obs-Exp|
GTExp). SPSS includes the LR test with contingency tables (CROSSTABS),
but not for goodness of fit test. Anyway, following my custom
(anything-can-be-done-with-matrix), here is a MATRIX program that can
be adapted to your data without much trouble (the only problem is that
it needs the categorical variable to be a string, not numerical, but
that could also be modified):
* Sample dataset *.
DATA LIST LIST/mice(A8) obs(F8).
BEGIN DATA
White 380
SBrPatch 330
LBrPatch 74
END DATA.
MATRIX.
PRINT /TITLE='GOODNESS OF FIT G-TEST'.
GET class /VAR=mice.
GET data /VAR= obs.
* Add here expected frequncies (under H0) *.
COMPUTE expected={51.0;40.8;8.2}.
COMPUTE expect=CSUM(data)*expected/MSUM(expected).
PRINT {data,expect,expected}
/FORMAT='F10.1'
/CLABEL='OBS','ESP','H0'
/RNAMES=class
/TITLE='Observed and expected frequencies'.
PRINT {NROW(expected)-1}
/FORMAT='F8.0'
/TITLE='Degrees of Freedom'.
COMPUTE totg=2*MSUM(data&*LN(data/expect)).
COMPUTE totsig=1-CHICDF(totg,NROW(expected)-1).
PRINT {totg;totsig}
/FORMAT='F8.4'
/RLABEL='Chi²','Sig'
/TITLE='G Statistic & significance'.
END MATRIX.
* Using Pearson Chi-square *.
AUTORECODE VARIABLES=mice /INTO color /DESCENDING /PRINT.
WEIGHT BY obs.
NPAR TEST
/CHISQUARE=color
/EXPECTED=51 40.8 8.2.
--
Regards,
Dr. Marta García-Granero,PhD mailto:
[hidden email]
Statistician
---
"It is unwise to use a statistical procedure whose use one does
not understand. SPSS syntax guide cannot supply this knowledge, and it
is certainly no substitute for the basic understanding of statistics
and statistical thinking that is essential for the wise choice of
methods and the correct interpretation of their results".
(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)
---------------------------------
Try the all-new Yahoo! Mail . "The New Version is radically easier to use" The Wall Street Journal