Fisher's exact test with R×C contingency table

버전 1.0.0 (4.97 KB) 작성자: qqffssxx
This function is based on Monte Carlo simulation, it support contingency tables larger than 2 * 2.
다운로드 수: 58
업데이트 날짜: 2023/3/15

라이선스 보기

The function 'fishertest' provided by MATLAB only supports contingency table of size 2 × 2, and although there have been many other scholarly published functions on File_Exchange to compute larger matrices, the results are somewhat problematic.
This function is based on Monte Carlo simulation, it support contingency tables larger than 2 * 2.
% Input variable: x
% x is the contingency table. You can use function 'crosstab' to generate the contingency table.
% num : the number of Monte Carlo simulations to be performed, default is 100000.
% Output variable: p
% p:p-values
% Source of subfunction 'rcont2': https://people.math.sc.edu/Burkardt/m_src/asa144/asa144.html
% for example
% x = [ 11 11
% 0 6
% 11 17];
% p = fisher_test_R_C(x)
% p = 0.0977;
% Because of the randomness in the algorithm, the result may be different each time.
% You can increase the value of 'num' to make the result more robust.
Reference:
  1. James Boyett,Algorithm AS 144: Random R x C Tables with Given Row and Column Totals,Applied Statistics,Volume 28, Number 3, 1979, pages 329-332.
https://people.math.sc.edu/Burkardt/m_src/asa144/asa144.html

인용 양식

qqffssxx (2024). Fisher's exact test with R×C contingency table (https://www.mathworks.com/matlabcentral/fileexchange/126355-fisher-s-exact-test-with-rxc-contingency-table), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2022b
R2010a 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0