chi2test

버전 1.0.0.0 (1.93 KB) 작성자: Peder Axensten
The chi-squared test.
다운로드 수: 6.4K
업데이트 날짜: 2007/8/30

라이선스 보기

Usage: [p, Q]= chi2test(x)

The chi-squared test.

Given a number of samples this function tests the hypothesis that the samples are
independent. If Q > chi2(p, nu), the hypothesis is rejected.

Each column represents a variables, each row a sample.

If you find any errors, please let me know: .

ARGUMENTS:
x Absolut numbers.
p The prob ability value, calculated from Q.
Q The resulting Q-value.

EXAMPLE 1
In region A, 324 of 556 cows were red, whereas in region B 98 of 260 were red.
[p, Q]= chi2test([324, 556-324; 98, 260-98])
p= 4.2073e-08
Q= 30.0515
With an error risk of about 4e-08, we can claim that the samples are independent.

EXAMPLE 2
Throw two different dices to see if they have the same probability of 1 (and 2, 3, 4, 5, 6).
We don't check if they are symetrical, only if the both behave in the same way.
[p,Q] = chi2test([15,10; 7,11; 9,7; 20,15; 26,21; 19,16])
p= 0.8200
Q = 2.2059
The dices don't significantly behave differently. That is, they seem to behave in the same way.

HISTORY: v.1.0, first working version, 2007-08-30.

COPYRIGHT: (c) 2007 Peder Axensten. Use at own risk.

인용 양식

Peder Axensten (2024). chi2test (https://www.mathworks.com/matlabcentral/fileexchange/16177-chi2test), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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