# Generalized linear model with mean contrast pairwise comparison versus chi-square tests

I have binary data on prevalence of infection (infected/all analysed) and I want to compare this proportion between groups (species and sexes).

I would like to ask if by conducting a Generalized Linear Model with binomial distribution and mean contrast pairwise comparison (with 1/0 as target variable and the groups and their interaction as factors), the pairwise results I get are "the same" as conducting separate chi-Square tests.

If it is the same, I am using SPSS and I get a significance for the model effects and a slightly different significance for the pairwise comparisons. Which one should I report? What do these differences mean?

If it is not the same, I would like to ask what is the correct way to construct the contingency table for comparing, for example, species A with 12/30 with species B with 8/22. And within species A, males have 10/17 and females 2/13, while within species B, males have 5/10 and females with 3/12. Can I use chi-square with different sample sizes of each group? Does anyone know how to do this in SPSS (I think it requires same sample size)?

For Species A versus Species B, the result from chi-square is Pearson=0.07, P=0.79. Thus no differences between species. For Male_A versus Female_A, result from chi-square is Pearson=5.79, P=0.02. Thus differences between sexes.

Is this correct?

Now imagine for A I have 4/29 and for B I have 2/16. If I am doing the chi-square table correctly, I have an additional problem of less than 5 in some cells, for which I only get Fisher's exact test. The results are only for Fisher Exact Probability Test, P one-tailed=0.64 and P two-tailed=1. Does this mean there are no differences? Which P is relevant and how can I get a chi-square value in these situations?