[R] Chi-squared approximation may be incorrect in: chisq.test(x)

Ethan Johnsons ethan.johnsons at gmail.com
Sat Dec 2 16:56:42 CET 2006


I am getting "Chi-squared approximation may be incorrect in:
chisq.test(x)"  with the data bleow.

Frequency distribution of number of male offspring in families of size 5.
Number of Male Offspring 	N
0 		                          518
1 		                         2245
2 		                          4621
3 		                          4753
4 		                          2476
5 		                            549
Total 		                      15,162


> x=matrix(c(0,1,2,3,4,5,518,2245,4621,4753,2476,549), ncol=2)
> x
     [,1] [,2]
[1,]    0  518
[2,]    1 2245
[3,]    2 4621
[4,]    3 4753
[5,]    4 2476
[6,]    5  549
> chisq.test(x)

        Pearson's Chi-squared test

data:  x
X-squared = 40.4672, df = 5, p-value = 1.202e-07

Warning message:
Chi-squared approximation may be incorrect in: chisq.test(x)

Does the warning mean that chisq.test(x) can't be used for this data.

If chisq.test(x) can't be used for this data, which test is to be used?

Pls advise.

thx

ej




More information about the R-help mailing list