# Perfect separation in logistic regression and data transformation -> can it help?

first of all, I am super happy that I found this great community. I am currently having trouble in my logistic regression analysis in that I get the error message display

Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred


I read a lot about the issues of perfect separation in this forum. A colleague told me that he is always using the log transformation of his data for his analysis (not logistic regression) and I noticed, that once I transformed the data, I won't get the error message anymore. Could this be a solution as well?

For background information, this is my data structure:

model <- glm(formula = Customer.group ~ Price.Index , family = binomial())


With Customer.group being yes (1) or no (0) and Where Price.Index is a calculated measure for each customer consisting of the weighted sum of a price paid for a product in a category divided by the average price in this category. So it is not actual observed data, but a calculated measure.

• I'm a bit puzzled by your dependent variables, if it is a sum of prices divided by an average price, is that not some continuous numerical response rather than a yes/no (or some integer out of a larger integer total)? So why use logistic regression? – Björn Jan 23 '17 at 13:22
• I am rather surprised that your colleague thinks log transforming makes separation go away. Can you show us the result of your models with and without log transforming PriceIndex so we can see the difference? – mdewey Jan 23 '17 at 13:28
• Hi Björn, my dependent variable is "Customer.Group" being binary as yes/no for indicating whether the customer is part of the group. My independent variable is the continuous price index which varies between ~0.1 and ~10 – Gabi Schneider Jan 23 '17 at 13:53

model <- glm(Customer.Group ~ Price.Index, data=yourdata, family="binomial") summary(model)
• Hi Michael! Thanks so much! I tried this formula and I still get the error message with the non-transformed data. I also used the safeBinaryRegression package to assess if there is a perfect separation which was found in my data. Therefore, I used the brglm package to run a Firth regression (which was successul). But because I wasn't sure what diagnostic statistics and model fit estimates to use for Firth regression, I tried to run the glm model again this time with the log-transformed data. I am just wondering, if this procedure would be statistically correct or if it wouldn't make sense. – Gabi Schneider Jan 23 '17 at 13:46