Path: news.mathworks.com!not-for-mail
From: "Tom Lane" <tlane@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: chi-square two sample test
Date: Mon, 5 Jan 2009 10:30:00 -0500
Organization: The MathWorks, Inc
Lines: 21
Message-ID: <gjt91o$phq$1@fred.mathworks.com>
References: <g2ls65$p3u$1@fred.mathworks.com> <g2lvan$1a3$1@fred.mathworks.com> <g2ntgq$r5e$1@fred.mathworks.com> <g2onqt$rmv$2@fred.mathworks.com> <g2qavh$399$1@fred.mathworks.com> <g2r8jt$den$2@fred.mathworks.com> <gje1t2$lul$1@fred.mathworks.com> <gjg2ic$foi$1@fred.mathworks.com> <gjmihd$oap$1@fred.mathworks.com>
Reply-To: "Tom Lane" <tlane@mathworks.com>
NNTP-Posting-Host: lanet.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1231169400 26170 172.31.57.151 (5 Jan 2009 15:30:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Jan 2009 15:30:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
Xref: news.mathworks.com comp.soft-sys.matlab:509856


> Yes, using the Pearson function from the Statistics Toolbox I could only 
> generate the random distribution. I'ts not possible to find the pdf or cdf 
> of that distribution directly so I used the histogram function to find the 
> frequency counts and bin locations of both samples (my data and pearson). 
> Then I used the algorithm in 
> http://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/chi2samp.htm 
> to calculate the test statistics. Here it says that the 2-samples test is 
> based on the binning of data so I thought it's what I should use anyway. 
> Does it sound right?
> I suppose it should be similar to your idea about having fixed bin 
> proportions. Am I right?

Mastaneh, sure, you could use a two-sample test if you want.  It's 
introducing extra variability (from the Pearson random sample), so it would 
probably be less sensitive than a one-sample test, but I suppose it would be 
valid.  You won't be able to use the chi2gof function, though -- that is for 
one-sample tests.

-- Tom