3
$\begingroup$

I am building a model to predict probabilities based on the scores given by a logistic regression. I have tried cv.glmnet but it doesn't give the probability score, instead it gives scores lying in (-0.06,0.289).

Please suggest a modeling technique that would predict probabilities which uses probabilities from another model as a DV.

Note: I used the same input for glm.fit function and it gives predicted probabilities ranging from 0 to 1 even when the dv is supposed to be binary when the family is assigned as binomial(). I believe the result is error prone as it is not designed to do it. It would be helpful if someone can explain this anomaly.

$\endgroup$
  • 1
    $\begingroup$ You can use glm() with a quasibinomial family! $\endgroup$ – kjetil b halvorsen Oct 17 '16 at 10:00
  • $\begingroup$ Can you clarify why you think that glm.fit is erring when it gives you probabilities in [0,1]? What values were you expecting? $\endgroup$ – mdewey Oct 17 '16 at 12:42
1
$\begingroup$

What predict() function is giving you is the linear value for the regression (called $\hat{f}(X)$) ; that is:

$\hat{f}(X) = \hat{\beta}_0 + \sum\limits_{i=1}^n \hat{\beta}_i X_i$.

So, to obtain the predicted probabilities (called $\hat{\pi}(X)$), you should use this transformation:

$\displaystyle\frac{e^{\hat{f}(X)}}{1 + e^{\hat{f}(X)}} = \displaystyle\frac{\hat{\beta}_0 + \sum\limits_{i=1}^n \hat{\beta}_i X_i}{1 + \hat{\beta}_0 + \sum\limits_{i=1}^n \hat{\beta}_i X_i}$.

This formula is the result of the inverse of the formula used to make the logistic model.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.