1

Possible Duplicate:
Properties of logistic regressions

I have built a logistic regression model with two covariates. Let $y_i$ be the binary responses and $\hat{\pi}_i$ the ML estimated probabilities for $i=1,\ldots,n$. Now it happens that $\sum_i{y_i}\neq\sum_i{\hat{\pi}_i}$. So, computing a chi-square goodness of fit test, sum of expected frequencies is different from sum of observed frequencies. Is this normal, or there is something wrong?

glassy
  • 1,012
  • 2
  • 10
  • 16
  • 1
    There's something wrong. You should have $\sum_i y_i = \sum_i \hat{\pi}_i$. Did you, perhaps, suppress the intercept? – Macro Apr 10 '12 at 16:06
  • No, I didn't suppress the intercept. Are you sure that the equality always holds? – glassy Apr 10 '12 at 17:06
  • 1
    Are you sure you didn't impose any sort of constraint on the fit? The unconstrained model fits the means and has the property that the average of the fitted probabilities is exactly equal to the proportion of '1's, so yes, this identity must hold. – Macro Apr 10 '12 at 17:09
  • 2
    You are right. I made a mistake in my calculations. I apologize. Thanks for your attention. – glassy Apr 10 '12 at 17:13

0 Answers0