Video: Modeling Data Using Logistic Regression

Some data sets can be modeled with nonlinear regression models. Which scatterplot shows data that can be best modeled by logistic regression? Which formula models the relationship between π‘₯ and 𝑦 in such a data set? [A] 𝑦 = 𝑐/(1 βˆ’ π‘Žπ‘’)^(𝑏π‘₯) [B] 𝑦 = 𝑐/(1 βˆ’ π‘Žπ‘’)^(βˆ’π‘π‘₯) [C] 𝑦 = 𝑐/(1 + π‘Žπ‘’)^(𝑏π‘₯) [D] 𝑦 = 𝑐/(1 + π‘Žπ‘’)^(βˆ’π‘π‘₯)

08:57

Video Transcript

Some data sets can be modeled with a nonlinear regression models. The first part of the question asks us which scatterplot shows data that can be best modelled by logistic regression? Is it scatterplot A), B), C), or D)? The second part of the question asks us which formula models the relationship between π‘₯ and 𝑦 in such a data set? Is it option A) 𝑦 equals 𝑐 over one minus π‘Žπ‘’ to the 𝑏π‘₯? Option B) 𝑦 equals 𝑐 over one minus π‘Žπ‘’ to the negative 𝑏π‘₯? Option C) 𝑦 equals 𝑐 over one plus π‘Žπ‘’ to the 𝑏π‘₯? Or option D) 𝑦 equals 𝑐 over one plus π‘Žπ‘’ to the negative 𝑏π‘₯?

Let’s start with the first part of the question, which scatterplot shows data that can be best modelled by logistic regression? For logistic regression to be suitable for a particular data set, that data should fall in a very distinctive shape when plotted on a scatter plot. We can see this very distinctive shape in option D. This shape is sometimes called an S-shape because the data tends to fall on or near a curve which has a somewhat slanted S-shape.

The characteristics of a logistic curve, for which logistic regression is named, are as follows. A logistic curve has a shallow slope which increases before plattering out again. Option D is the only option which displays these characteristics.

We can draw a nice smooth curve through or near the data points for option B. But while this curve starts off shallow and gets steeper as we’d like it to for a regression curve, it’s never plattered out again. And we need the slope to become a shallower and the curve to platter out for logistic regression to be suitable. The data in option B, therefore, isn’t particularly suitable to be modelled by logistic regression.

For options A and C, it’s pretty hard to draw a nice smooth curve through or near the data points. But certainly, we don’t see a shallow slope becoming steeper before plattering out again. Option D is the only one that makes sense.

Now we move on to the second part of our question, which formula models the relationship between π‘₯ and 𝑦 in such a data set? All the options have the same form. The question is whether there’s a plus or a minus after the one in the denominator, and whether there is a minus sign before 𝑏π‘₯ in the exponent.

Of course, if A and B are allowed to be negative, then all of these formulas are equivalent. We can get formula A from formula B by changing the value of B to its additive inverse, or opposite. We, therefore, assume that both A and B are positive. And that these options are showing us the form of the formula that we expect to see.

To decide which option is correct, it helps to look at the previous part of the question and to extend the curve we’ve drawn in both directions. We can see that as π‘₯ approaches negative ∞, we want 𝑦 to decrease, getting closer and closer to zero. 𝑦 tends to zero as π‘₯ tends to negative ∞. Looking at the other end of the curve, we see that as π‘₯ approaches positive ∞, we want 𝑦 to asymptotically approach sum finite value. So, 𝑦 tends to this finite value π‘˜ as π‘₯ approaches ∞.

We can use these facts to choose between our options. But first we need to clear some room, so we have space to work. Let’s try option A first. Does 𝑦 equals 𝑐 over one minus π‘Žπ‘’ to the 𝑏π‘₯ tend to zero as π‘₯ tends to negative ∞ as we would like? Well, for this fraction to tend to zero, as the numerator 𝑐 is unchanging, the denominator will have to tend to plus or minus ∞. And does it?

No, it doesn’t. And as π‘₯ tends negative ∞, 𝑒 to the 𝑏π‘₯ tends to zero. This is because we said that 𝑏 is greater than zero. Similarly, π‘Ž times 𝑒 to the 𝑏π‘₯ will tend to zero, as well negative π‘Žπ‘’ to the 𝑏π‘₯. And so, one minus π‘Žπ‘’ to the 𝑏π‘₯ will tend to one, not plus or minus ∞ as we require. We can, therefore, eliminate options A, as in this case, 𝑦 does not tend to zero as π‘₯ tends to negative ∞.

If we replace the minus sign in the denominator with a plus sign, we find that one plus π‘Ž to the 𝑏π‘₯ also tends to one, as π‘₯ tends to negative ∞. And for this reason, we can also eliminate option C, 𝑦 equals 𝑐 over one plus π‘Žπ‘’ to the 𝑏π‘₯. As it doesn’t tend to zero as π‘₯ tends to negative ∞. Let’s move on to option B.

We ask if option B, 𝑦 equals 𝑐 over one minus π‘Žπ‘’ to the negative 𝑏π‘₯, tend to zero as π‘₯ tends to negative ∞. And for this to happen, the denominator one minus π‘Žπ‘’ to the negative 𝑏π‘₯ must tend to either plus or minus ∞ as π‘₯ tends to negative ∞. In this case, the answer is yes. As π‘₯ tends to negative ∞, negative 𝑏π‘₯ tends to ∞. This is because 𝑏 is greater than zero. And so, each of the negative 𝑏π‘₯ will tend to ∞, as will π‘Žπ‘’ to the negative 𝑏π‘₯, as π‘Ž is greater than zero.

However, negative π‘Žπ‘’ to the negative 𝑏π‘₯ will tend to negative ∞. And adding one to this doesn’t do much to change this. One minus π‘Žπ‘’ to the negative 𝑏π‘₯ also tends to negative ∞ as π‘₯ tends to negative ∞. So, the denominator of our fraction tends to negative ∞ as π‘₯ tends to negative ∞. And so, our fraction itself tends to zero, as π‘₯ tends to negative ∞ as we wish.

But before we get too excited, let’s just stop and think. The denominator of this fraction for 𝑦 tends to negative ∞, so it’s negative. And as you imagined that the numerator of our fraction for 𝑦, which is 𝑐, is positive, much like A and B. The value of 𝑦, which is 𝑐 over something negative, will be negative. 𝑦 is negative and approaching zero from below. This isn’t what we see in our diagram. Something strange is going on and you might like to use graphing software to explore what. But it looks like option B is out of the running.

In option D, the minus sign of the one in the denominator becomes a plus sign. And we ask if one plus π‘Žπ‘’ to the negative 𝑏π‘₯ tends to plus or minus ∞. Again, the answer is yes, but plus π‘Žπ‘’ to the negative 𝑏π‘₯ tends to plus ∞. And one plus π‘Žπ‘’ to the negative 𝑏π‘₯ does also. And so, one plus π‘Žπ‘’ to the negative 𝑏π‘₯ is greater than zero. And it turns out that this is not true for suitably small π‘₯, it’s true for all 𝑋.

This means that 𝑦 is positive as we want and expect. So, we have no such problem with option D, which is good news because we’ve eliminated all the other options. Option D is, therefore, our answer. You might notice that we haven’t checked that 𝑦 tends to some constant value π‘˜ as π‘₯ tends to ∞. We don’t need to check this, as we already found our answer by a process of elimination.

But if you do check this, then you’ll find that π‘˜ is, in fact, the value 𝑐, the numerator of our fraction. This also justifies the previous assumption that 𝑐 should be positive like π‘Ž and 𝑏. We use this assumption to show that 𝑦 would be less than zero for suitably small π‘₯ in option B. This formula 𝑦 equals 𝑐 over one plus π‘Žπ‘’ to the negative 𝑏π‘₯ for logistic regression is well-worth remembering. As we’ve just seen it’s not particularly easy to work this formula out using logic alone.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.