how to calculate logistic regression coefficient manually