I don't see a big difference in the results:
d = read.table(text="Group Black Red
A 296 14
B 292 16
C 301 7
D 289 23", header=T)
chisq.test(d[,2:3])
# Pearson's Chi-squared test
#
# data: d[, 2:3]
# X-squared = 8.893, df = 3, p-value = 0.03075
mod = glm(cbind(Black, Red)~Group, data=d, family=binomial)
summary(mod)
# ...
# Coefficients:
# Estimate Std. Error z value Pr(>|z|)
# (Intercept) 3.0513 0.2735 11.156 <2e-16 ***
# GroupB -0.1471 0.3751 -0.392 0.695
# GroupC 0.7099 0.4701 1.510 0.131
# GroupD -0.5204 0.3489 -1.491 0.136
# ...
#
# Null deviance: 9.3651e+00 on 3 degrees of freedom
# Residual deviance: 1.1902e-13 on 0 degrees of freedom
# AIC: 25.699
1-pchisq((9.3651 - 1.1902e-13), df=(3-0))
# [1] 0.02481063
The GLM is, if anything, slightly more significant. I wonder if this is a confusion about how to interpret statistical output from a model with categorical variables. When you have a categorical variable, most software (including R, above) uses reference cell coding (see here). The first level of the variable becomes the intercept, and the other levels are compared to the intercept. Thus, the output shows that B
, C
, and D
do not significantly differ from A
, but that doesn't mean they don't differ from each other (C
and D
look like they will, e.g.). To test if the entire factor / categorical variable is significant, you need to fit a new model without that variable and perform a nested model test. Since you have only one variable, you can just calculate the significance of the whole model directly using the null and residual deviance (see here).