# Expected value

#### quirk

##### New Member
I've used Logistic regression to calculate a risk score for death. I've also calculated the probability of dying based on this score. I want to show the expected number of deaths for each decile of the score - how do I do this?

Thanks,
Q

#### ichbin

##### New Member
A logistic model assumes the probability of death P as a function of the score x takes the form

$$P = \frac{e^{f(x)}}{1+e^{f(x)}} \qquad f(x) = a + b x$$

and your logistic regression has given you best-fit values of a and b.

A good approximation to the risk-of-death for each decile is to find the midpoint value of x for each decile and just plug that value in to the formula above for P.

You can try to get slightly fancier by finding the score interval corresponding to each decile and integrating over that interval to find the average P, but then you have to start to get into thorny questions beyond the scope of your regression analysis, like what is your model for the distribution of x in the population. The approximation I suggested above it fine for giving people a reasonable idea of their risk.