From ehlers at math.ucalgary.ca  Sun Oct 30 15:49:00 2005
From: ehlers at math.ucalgary.ca (P Ehlers)
Date: Sun, 30 Oct 2005 07:49:00 -0700
Subject: [Rd] Yates' correction for continuity in chisq.test (PR#8265)
In-Reply-To: <20051030140726.95628205FA@slim.kubism.ku.dk>
References: <20051030140726.95628205FA@slim.kubism.ku.dk>
Message-ID: <4364DD5C.7090508@math.ucalgary.ca>


dih69530 at syd.odn.ne.jp wrote:
> Full_Name: foo ba baz
> Version: R2.2.0
> OS: Mac OS X (10.4)
> Submission from: (NULL) (219.66.32.183)
> 
> 
> chisq.test(matrix(c(9,10,9,11),2,2))
> 
> Chi-square value must be 0, and, P value must be 0
> R does over correction
> 
> when | a d - b c | < n / 2 &#65292;chi-sq must be 0
> 

(Presumably, you mean P-value = 1.)
If you don't want the correction, set correct=FALSE. (The
results won't differ much.)

A better example is

  chisq.test(matrix(c(9,10,9,10),2,2))

for which R probably should return X-squared = 0.

Peter Ehlers



[Rd] Yates' correction for continuity in chisq.test (PR#8265)
P Ehlers