'Unexpected result from lpSolveAPI for primal test' error for Logistic Regression

840 views Asked by At

I am trying build a logistic regression model in R and I am also using the 'safeBinaryRegression' package. When I enter the my model code and hit enter, I get the following message:

Error in separator(X, Y, purpose = "find") : unexpected result from lpSolveAPI for primal test

I am not sure what this error means and how to resolve this. Does this mean that there is something wrong with my data or something else?

I'd greatly appreciate if someone can help me to understand this error and how to resolve it.

Very much appreciate your time and insights in advance.

2

There are 2 answers

0
jruf003 On

I had the same problem. In the end it went away when I converted the response from a numeric variable to a factor.

0
coip On

Does this mean that there is something wrong with my data?

Potentially, yes. This error message is the purpose of the safeBinaryRegression package. You should amend your code to include separation = 'find' to identify the terms that are causing issues for the maximum likelihood estimate:

library(safeBinaryRegression)
mod <- glm(y ~ x, family = binomial, separation = 'find')