I am a medical scientist but an amateur statistician (not even amateur). I have a simple question. Here is the output from a logistic regression examining a number of variables which may predict if a doctor will perform a biopsy in a patient or not. So the dependent variable is "biopsy or not". It's been run in 24240 doctor-patient consultation.

enter image description here

What I want to do is evaluate the relationship between these variables and biopsy decisions in each INDIVIDUAL doctor-patient consultation using the logistic regression equation and these coefficients.

My primary question is:

If apply:

    age * -.02742 + dlco * 0.0053058 + pioped_intermediate * 1.244477 + pioped_ipf_intermediate * 0.172851 + .6047641

to an individual doctor-patient consultation, am I correct in thinking I should get a result between 0 and 1? If I am getting values that range from -1.6 to +1.5 does that indicate there is a mistake in my calculations?

I hope this makes sense (and its acceptable to upload a screenshot).


1 Answer 1


No. Your linear function could return any real value. You are supposed to put that value into the logistic function to get a probability value between 0 and 1. That's really the whole trick of logistic regression: to create a mapping between a scale with range $[0, 1]$ and range $[-\infty,+\infty]$.

  • $\begingroup$ Thanks, David - are you saying the equation is the linear function and that value goes into Log(p/1-p)? $\endgroup$
    – GhostRider
    Commented Aug 10, 2017 at 13:47
  • 3
    $\begingroup$ It actually goes into the inverse function of that: exp(x) / (1 + exp(x)) $\endgroup$ Commented Aug 10, 2017 at 13:51
  • $\begingroup$ Almost. Your expression is the linear function, and its value goes into the logistic function $p = e^t/(e^t +1)$, which the inverse of the logit function $t = \ln(p / (1-p))$. $\endgroup$ Commented Aug 10, 2017 at 13:51
  • $\begingroup$ Many thanks - this works as I expected. Sorry for the ridiculously basic question. $\endgroup$
    – GhostRider
    Commented Aug 10, 2017 at 13:53
  • 1
    $\begingroup$ You are at liberty to put your cut-off anywhere you want depending on the costs and benefits of the right and wrong decisions (true, false positives, true, false negatives). In the absence of that information 0.5 is conventional. $\endgroup$
    – mdewey
    Commented Aug 10, 2017 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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