I am fitting a binomial logistic regression in R using glm. By chance, I have found out that if I change the order of my predictor variables, glm fails to estimate the model. The message I get is unexpected result from lpSolveAPI for primal test.
I am using the safeBinaryRegression package, so I am confident there are no separation issues between my outcome and predictor variables. However, I am not so confident that there are no quasi-separation issues among my predictor variables. Am I correct that if this is the case, then I might be running into multicolinearity, and this is the source of glm not being able to fit the model?
If so, my question is for advice on how to approach the issue. Should I look for the predictor variables highly correlated and omit one of them? Is there any convenient way of doing so for 11 categorical predictors?
What I see right now:
lModel <- glm(mob_change ~ education + gender + start_age +
income + dist_change + lu_change + dou_change +
marriage + student2work + wh_change,
data = regression_data,
family = binomial())
# Fine, and I can inspect the model. No predictor has
# std. error > 1.05
Now if I move the last variable (or any of the last three,
for what I've tested) to
be the first in predictor ...
lModel.3 <- glm(mob_change ~ wh_change + gender + education +
start_age + income + dist_change + lu_change +
dou_change + marriage + student2work,
data = regression_data,
family = binomial())
Error in separator(X, Y, purpose = "find") :
unexpected result from lpSolveAPI for primal test
safeBinaryRegressionchanges theglmfunction fromstatto test for separation first & it's this test that's giving an error message for some reason - not even telling you whether there's separation or not. Of course the order of the predictors is irrelevant to the question. – Scortchi - Reinstate Monica Feb 12 '15 at 16:37start_ageare categorical, Andrew – nazareno Feb 19 '15 at 14:27