Code covered by the BSD License  

Highlights from
Pearson Chi Square Hypothesis Test

3.0

3.0 | 7 ratings Rate this file 17 Downloads (last 30 days) File Size: 2.14 KB File ID: #3596
image thumbnail

Pearson Chi Square Hypothesis Test

by G. Levin

 

12 Jun 2003 (Updated 20 Jun 2003)

Single sample Pearson Chi Square goodness-of-fit hypothesis test.

| Watch this File

File Information
Description

CHI2TEST: Single sample Pearson Chi Square goodness-of-fit hypothesis test.

H=CHI2TEST(X,ALPHA) performs the particular case of Pearson Chi Square test to determine whether the null hypothesis of composite normality PDF is a reasonable assumption regarding the population distribution of a random sample X with the desired significance level ALPHA.

H indicates the result of the hypothesis test according to the MATLAB rules of conditional statements:
H=1 => Do not reject the null hypothesis at significance level ALPHA.
H=0 => Reject the null hypothesis at significance level ALPHA.

The Chi Square hypotheses and test statistic in this particular case are:
 
Null Hypothesis: X is normal with unknown mean and variance.
Alternative Hypothesis: X is not normal.

The random sample X is shifted by its estimated mean and normalized by its
estimated standard deviation. The tested bins XP of the assumed normal distribution are chosen [-inf, -1.6:0.4:1.6, inf] to avoid unsufficient statistics.

Let E(x) be the expected frequency of X falls into XP according to the normal distribution and O(x) be the observed frequency. The Pearson statistics
X2=SUM((E(x)-O(x))^2/E(x)) distributes Chi Square with length(XP)-3 degrees of freedom.

The decision to reject the null hypothesis is taken when the P value (probability that Chi2 random value with length(XP)-3 degrees of freedom is greater than X2)is less than significance level ALPHA.

X must be a row vector representing a random sample. ALPHA must be a scalar.
The function doesn't check the formats of X and ALPHA, as well as a number of the input and output parameters.

The asymptotic limit of the Chi Square Test presented is reached when
LENGTH(X)>90.

Acknowledge: Dr. S. Loyka

Author: G. Levin, May, 2003.

References:
W. T. Eadie, D. Drijard, F. E. James, M Roos and B. Sadoulet, "Statistical Methods in Experimental Physics", North-Holland, Sec. Reprint, 1982.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
07 Nov 2003 nida rasheed

too much jargon - even though i know about social research i couldn't figure this out...

22 Jun 2004 dave conner  
08 Oct 2005 Jerry Lam

well, those are not jargon, they are the proper vocabularies...

09 Mar 2006 Dasa Zeithamova

Just what I needed. Output should be more see-through, eg specifying chi statistics and p-value, not only reject/accept.

28 Apr 2007 Anthony Carnemolla

I have not used this, but I think the H-value is backwards. Matlab help files state that it uses H=0 for 'do NOT reject' null hypothesis.

25 Jun 2007 Constantinos Koutsojannis  
26 Jan 2008 pat daudu

i'm reasonablly satisfied with mysurf on this page.

Please login to add a comment or rating.
Updates
17 Jun 2003

Misspells correction

20 Jun 2003

Misspells correction

Tag Activity for this File
Tag Applied By Date/Time
statistics G. Levin 22 Oct 2008 07:03:02
probability G. Levin 22 Oct 2008 07:03:02
chi G. Levin 22 Oct 2008 07:03:02
square G. Levin 22 Oct 2008 07:03:02
test G. Levin 22 Oct 2008 07:03:02
population G. Levin 22 Oct 2008 07:03:02
normality G. Levin 22 Oct 2008 07:03:02
pearson G. Levin 22 Oct 2008 07:03:02
chi David Zuliani 22 Dec 2008 02:10:08
normality Ameur 27 Oct 2011 21:42:26
chi Andres Cardozo 21 Nov 2011 01:37:00

Contact us at files@mathworks.com