# Is it valid to get better performance in logistic regression using only a subset of the coefficients?

I have an imbalanced data set containing 12% of the positive class 88% negative. First, I ran a logistic regression with all my coefficients and got an average accuracy of 0.91 (I know that's not quite good given my class distribution), average sensitivity of 0.34 and average specificity of 0.97. Then I ran an additional logistic regression only using a subset of the coefficients. On average, I got higher accuracy, that is 0.98, lower sensitivity 0.32 and higher specificity, i.e. 0.98 . Is this quite normal or an error in my code? Or is it because of the class distribution, that the classifier using more coefficients is even better in predicting the majority class but worse in predicting the minority class?

• See the wikipedia entry for logistic regression. Given a representative sample the binary logistic model directly estimates Prob($Y=1|X$). Yes if you use the Brier score or a score that comes from the log likelihood itself (logarithmic scoring rule or pseudo $R^2$) you will not see illogical results. – Frank Harrell Dec 18 '15 at 13:36