Hi, I am trying to see if the use of different habitats has an effect in the infestation level in a certain host population. Therefore, my dependent variable is Parasitation, witht he value "0" if the individual wasn't parasitized and "1" if it was, and my response variable is Habitat ("Bamboo", "Open", "Rhododendron"). I also have the covariable "Year" (the samples were different from year to year).

I consulted The R book" by Michael J Crawley and saw that, for my case, the best would be to perform a contingency table analysis (Chapter 15), using a glm with Poisson distribution. For my despair, I am not being able to correctly import/ build the contingency table in R, because it isn't 2 by 2.

I tried to build this in excel and saved it as a csv and also as a txt, but I fail in correctly importing the table.

I would like R to read the table as shown in "Contingency table".

I used this code ct2

More Maria Inês Cardoso de Sousa Silva's questions See All
Similar questions and discussions