[R] about chisq.test()

Dejian Zhao zhaodj at ioz.ac.cn
Wed May 19 16:44:42 CEST 2010

 Dear all,

I want to check whether 5 decimal data is 1:1:1:1:1. For example,
data = c(14.3,16.2,14.7,18.7,14.5)
Since chisq.test() can do the goodness-of-fit test, it becomes my 
choice. However, I find in the "?chisq.test" help file that it requires 
"non-negative integers"! It seems that it is inappropriate to do the 
test using this function.

The function requires "integer". But what if we input some decimals as 
mentioned above? Actually I did it and it seems goes well.

 > data = c(14.3,16.2,14.7,18.7,14.5)
 > chisq.test(data)
         Chi-squared test for given probabilities
data:  data
X-squared = 0.8704, df = 4, p-value = 0.9288

Is this result reliable?


More information about the R-help mailing list