mercredi 10 mars 2021

How can I use contingency table, and fisher test in R, given counts

I know table() creates a table of two categorical variables from the data by counting. But my issue is that I am already given a table. Table

I am supposed to test whether flower color affects color survivorship using chisq.test() and fisher.test(). If i create a tibble

color_tibble <- tibble(
White = c(143, 130),
Light = c(184, 100),
Dark = c(176, 107) )                              

chisq.test(color_tibble$White)

That works to conduct chisq tests for all three colors, but I would not be able to use the fisher test because it is not an actual contingency table, nor are there two categorical variables to compare. I have no actual data set/frame to create a table using table().

Ideally I would like to compare the categorical variables "color" with values white/light/dark and "survivorship" values survived/dead.

hopefully this makes sense to you

Aucun commentaire:

Enregistrer un commentaire