Chi-square tests

Three Chi-square tests of homogeneity and independence (Read-Cressie, Pearson or Log Likelihood)
1.5K Downloads
Updated 23 Dec 2010

View License

Chi-square tests of homogeneity and independence.
Computes the P-value for I x J - table row/col independence.
Ref.: DeltaProt toolbox at http://services.cbu.uib.no/software/deltaprot/

Input:
X: data matrix (I x J -table) of the observed frequency cells.
method: 'RC': Read-Cressie power divergence statistics (default), lambda= 2/3
'Pe': Standard Pearson chi2-distance, lambda= 1
'LL': Log Likelihood ratio distance, lambda= 0

Output:
P-value

Use: P = chi2Tests(Observed,'RC')

The P-value is computed through approximation with chi-2 distribution
under the null hypothesis for all methods.
The 'RC'-method is sligtly better than the 'Pe'-method in small tables with unbalanced column margins

Please, use the following reference:
Thorvaldsen, S. , Flå, T. and Willassen, N.P. (2010) DeltaProt: a software toolbox for comparative genomics. BMC Bioinformatics 2010, Vol 11:573.
See http://www.biomedcentral.com/1471-2105/11/573

Other reference:
Rudas, T. (1986): A Monte Carlo Comparision of Small Sample Behaviour
of The Pearson, the Likelihood Ratio and the Cressie-Read Statistics. J.Statist. Comput. Simul, vol 24, pp 107-120.
Read, TRC and Cressie, NAC (1988): Goodness of Fit Statistics for Discrete Multivariate Data. Springer Verlag.
Ewens, WJ and Grant, GR (2001): Statistical Methods in Bioinformatics. Springer Verlag.

Cite As

Steinar Thorvaldsen (2024). Chi-square tests (https://www.mathworks.com/matlabcentral/fileexchange/29817-chi-square-tests), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Updated description

1.0.0.0