[R] chisq.test

Peter Ehlers ehlers at ucalgary.ca
Tue Jun 26 22:58:48 CEST 2012


On 2012-06-26 11:27, Omphalodes Verna wrote:
> Dear list!
>
> I would like to calculate "chisq.test" on simple data set with 70 observations, but the output is ''Warning message:''
>
> Warning message:
> In chisq.test(tabele) : Chi-squared approximation may be incorrect
>
>
> Here is an example:
>
>          tabele<- matrix(c(11, 3, 3, 18, 3, 6, 5, 21), ncol = 4, byrow = TRUE)
>          dimnames(tabela)<- list(
>          "SEX" = c("M","F"),
>          "HAIR" = c("Brown", "Black", "Red", "Blonde"))
>          addmargins(tabele)
>          prop.table(tabele)
>          chisq.test(tabele)
> Please, give me an advice / suggestion / recommendation.

Do this:

   ct <- chisq.test(tabele)
   ct$expected

If that does not give you a sufficient hint, then you need
to review the assumptions underlying the chisquare test.

Peter Ehlers

>
> Thanks a lot to all, OV
>
> 	[[alternative HTML version deleted]]



More information about the R-help mailing list