# Should the logistic regression equation always result in a value between 0 and 1?

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.

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).

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]$.
• 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))$. Aug 10 '17 at 13:51