I want to run a logistic regression with a binary outcome (correct vs incorrect) and three predictors: condition (2 levels: A and B), and time (2 levels: before and after), and their interaction. I've run into a problem, however, in that the model gives meaningless parameter estimates with huge SEs. I'm pretty sure the reason is that for one level of the condition predictor the outcome is always correct. Alternatively, it could be that there is some missing data (see below) but my understanding is that this shouldn't be a problem for logistic regression.
The counts are:
- Cond A T1: 28 of 28 correct
- Cond B T1: 23 of 26 correct
- Cond A T2: 30 of 30 correct
- Cond B T2: 24 of 30 correct
Is there a way I can run this analysis? The reason being that if I just use chi-square to compare the counts then it looks as though at T2 there is a significant difference between Cond A and Cond B, but this doesn't account for the fact that Cond B was already doing worse at T1. I'd also like to test for a main effect of condition.
EDIT: I realize I didn't model the within-subj variance, which I can do with this code by adding it as a random effect in a mixed model:
glmer(df$outcome ~ df$condition*df$time + (1|d$ID), family=binomial(logit))
However I get an error message that the "model is nearly unidentifiable: large eignenvalue ratio". Additionally, the estimates are identical whether I use this model or the one where I didn't model within-subject error as a random effect, which made me wonder if I was doing something wrong. There was, however, some variance associated with this term so maybe it's fine (aside from the error message)?