# Logistic regression "1 not defined because of singularities"

I'm fitting a logistic regression model with patient_group (0,1) as response variable and the explanatory variable being an interaction between two SNPs. When running summary for the model, the alert 'Coefficients: (1 not defined because of singularities)' is shown, and I guess it is due to the fact that the combination AACT has 0 observations.

My question is whether the statistics are still valid, or is there a better way to analyse this kind of data? (The SNPs are located close to each other and are most likely strongly linked.)

> table(data$SNP1, data$SNP2)
CC CT
TT 27  9
AT 83 14
AA 47  0
> model <- glm(patient_group ~ SNP1 * SNP2, data=data, family="binomial")
> summary(model)
Call:
glm(formula = patient_group ~ SNP1 * SNP2, family = "binomial",
data = data)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-1.2735  -0.9072  -0.7679   1.4742   1.8365

Coefficients: (1 not defined because of singularities)
Estimate Std. Error z value Pr(>|z|)
(Intercept)    -1.4816     0.4954  -2.991  0.00279 **
SNP1AT          0.8065     0.5471   1.474  0.14048
SNP1AA          0.4112     0.5978   0.688  0.49158
SNP2CT          1.7047     0.8339   2.044  0.04093 *
SNP1AT:SNP2CT  -2.3289     1.0833  -2.150  0.03157 *
SNP1AA:SNP2CT       NA         NA      NA       NA

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 218.19  on 179  degrees of freedom
Residual deviance: 212.31  on 175  degrees of freedom
(26 observations deleted due to missingness)
AIC: 222.31

Number of Fisher Scoring iterations: 4

• Possible duplicate of How to deal with perfect separation in logistic regression?
– Sycorax
Mar 13, 2016 at 19:09
• This is not a case of separation. Note, eg, that the SEs are not large & the number of iterations is 4. Instead, the issue will be what the OP says, "the combination AACT has 0 observations". This thread should stay open, IMO. Mar 13, 2016 at 20:57

Your explanation is correct, it is the zero in the cross-classification (thanks for showing us that) which causes software to fail to give you an estimate for that part of the interactions. Whether this matters is really a scientific question not statistical since it means that you do not have the data to tell whether having both SNP1AA and SNP2CT is different from what would be predicted on the basis of knowing each effect separately.

If you have no patients in the cross-tabulated CT:AA cell it really begs for an answer to "why". Is it just a sampling anomaly, or is it telling you something about the biology of these two genotypes? How likely is it that you could get this two way result. To me it "looks" fairly unlikely and it rather easy to continue using R to derive an statisical measure of its unlikely-ness:

> dat <- matrix(scan(), 3,2,byrow=TRUE, dimnames=list(c('TT','AT','AA'), c("CC","CT")))
1:    27  9
3:    83 14
5:    47  0
7:
> dat
CC CT
TT 27  9
AT 83 14
AA 47  0
> fisher.test(dat)

Fisher's Exact Test for Count Data

data:  dat
p-value = 0.00059
alternative hypothesis: two.sided


This example also reminds me of earlier discussions about how one puts confidence limits around situations where an observation with two possible outcomes only has one of those outcomes. Do a search in CV.com for "binomial rule of 3".