Message-ID: <C0AADED7-8F5A-4E11-9F8A-86E51AA0D3CE@comcast.net>
Date: 2009-04-12T23:45:07Z
From: David Winsemius
Subject: goodness of fit between two samples of size N (discrete variable)
In-Reply-To: <550002.37192.qm@web30602.mail.mud.yahoo.com>
On Apr 12, 2009, at 3:09 PM, jose romero wrote:
>
> Hello list:
>
> I generate by simulation (using different procedures) two sample
> vectors of size N, each corresponding to a discrete variable and I
> want to text if these samples can be considered as having the same
> probability distribution (which is unknown). What is the best test
> for that?
> I've read that Kolmogorov-Smirnov and Anderson-Darling tests are
> restricted to continuous data (http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf
> ), while chi-square can handle discrete data, but how do i test (in
> R) equivalence of ditribution in 2 samples using it? Are there
> better tests than those i mentioned?
The question of whether two discrete samples are independent,
conditional on their joint marginals is generally handled with a chi-
square test. The theoretical distribution is only approximately chi-
square, but is seems close enough that most people will accept it.
This is not a test of "equivalence". Ricci deals with the cases where
one sample is fitted to a theoretical distribution. You do not seem to
have that situation.
?chisq.test
I find myself wondering to what purpose you are seeking these answers.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT