Skip to content
Prev 15824 / 63461 Next

chi-square test

if you print "chisq.test()" you'll see when this warning message 
appears (i.e., if any expected count is less than 5, in which case it 
is known that the approximation to the Chi-squared distribution may 
not be adequate).

Alternatively, you could simulate to approximate the reference 
distribution of the statistic and obtain an estimation of the p-value 
using:

chisq.test(matrix(c(20.1, 18.5, 2.6, 32.9, 23.5, 5.4), nc = 2), 
simulate.p.value = TRUE)

I hope it helps.

Best,
Dimitris

p.s., you should send this message to r-help and not r-devel.

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm



----- Original Message ----- 
From: "Benjamin Chan [BRE]" <Benjamin.Chan@inet.polyu.edu.hk>
To: <r-devel@stat.math.ethz.ch>
Sent: Tuesday, April 19, 2005 10:47 AM
Subject: [Rd] chi-square test