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?