MyBarnard

버전 2.0.0.1 (17.5 KB) 작성자: Giuseppe Cardillo
A very compact and fast routine for Barnard's exact test on 2x2 matrix
다운로드 수: 1.3K
업데이트 날짜: 2019/1/28

There are two fundamentally different exact tests for comparing the equality of two binomial probabilities – Fisher’s exact test (Fisher, 1925), and Barnard’s exact test (Barnard, 1945). Fisher’s exact test (Fisher, 1925) is the more popular of the two. In fact, Fisher was bitterly critical of Barnard’s proposal for esoteric reasons that we will not go into here. For 2 × 2 tables, Barnard’s test is more powerful than Fisher’s, as Barnard noted in his 1945 paper, much to Fisher’s chagrin (see C.R. Mehta and P. Senchaudhuri: Conditional versus unconditional exact tests for comparing two binomials. www.cytel.com/papers/twobinomials.pdf). Anyway, perhaps due to its computational difficulty the Barnard's is not widely used. This function is completely vectorized and without for...end loops, and so, the computation is very fast. In FEX there is only one other function that computes the Barnard's exact test by Antonio Trujillo-Ortiz.
Using this matrix x=[7 12; 8 3]; switching off the input error checks and display results sections in both functions; the performs are:
L=1000; times=zeros(1,L); for I=1:L, tic; mybarnard(x); times(I)=toc; end, median(times)
ans = 0.0028
L=1000; times=zeros(1,L); for I=1:L, tic; Barnardextest(7,12,8,3); times(I)=toc; end, median(times)
ans = 1.2478

So my function is about 450 times faster.

인용 양식

Giuseppe Cardillo (2024). MyBarnard (https://github.com/dnafinder/barnard), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2014b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 ANOVA에 대해 자세히 알아보기
도움

받음: Barnardextest

Community Treasure Hunt

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

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
2.0.0.1

change in description

2.0.0.0

inputparser; github link

1.4.0.0

I added: 1) the plots of Wald statistics; 2) a flag to choose if the plots must be shown

1.3.0.0

Changes in description

1.2.0.0

Change in description

1.1.0.0

change in help section to correctly cite this function

1.0.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.