Skip to main content
Advanced Statistical Methods

Residual Analysis, Dummy Variables, and Logistic Regression

Published: 2026-08-11
Level: postgraduate
Audience: Postgraduate students in Advanced Statistical Methods

Prerequisite Knowledge

This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.

Previously Covered in This Subject

  • Simple and multiple linear regression, and the decomposition of variation (SST, SSR, SSE) — covered in Lectures 8 and 9
  • The coefficient of determination and reading regression output — covered in Lectures 8 and 9
  • Adjusted R-squared and the redundant-variable problem — covered in Lectures 8 and 9
  • T tests and F tests for regression significance — covered in Lectures 8 and 9
  • Multicollinearity and the correlation-matrix 0.7 rule — covered in Lectures 8 and 9
  • Dummy variables for categorical predictors — covered in Lecture 9

10.1 Regression Recap: The Toolkit from the Previous Session

10.1.1 Simple and Multiple Linear Regression

Hook: A business analyst wants to predict sales from the price of a product. One predictor is never enough in practice — but how does the model change as predictors are added? This section reconnects with the regression toolkit built in the previous session before the session extends it.

The discussion opened by reconnecting with the regression analysis built in the previous session. Two fundamental techniques were introduced there: simple linear regression — one dependent variable explained by a single independent variable — and multiple linear regression — one dependent variable explained by several independent variables at once. Both are predictive tools: they describe how the response changes as the predictors change, and they allow us to forecast the response at new predictor values.

The simple linear regression model relates the dependent variable to one independent variable through a linear equation with an error term:

In words: "beta naught plus beta 1 x plus some epsilon." Here is the intercept — the value of when is zero — is the slope — how much changes for a one-unit increase in — and is the error term, the part of the line cannot explain. The error term is essential: without it the equation would claim every data point sits exactly on the line, which never happens with real data.

The multiple linear regression version expresses the expected value of as a linear combination of independent variables:

In words: "the expected value of y equals beta naught plus beta 1 x1 plus beta 2 x2, and so on, up to p independent variables." Each is a population coefficient, and in practice the Greek letters are replaced by sample estimates found through least squares — the approach that picks the estimates so that the sum of the squared vertical deviations of the observations from the fitted line is as small as possible. In the earlier session the least-squares formulas were not re-derived from calculus; the class took the support of the software output and went straight to interpretation.

The two model forms side by side.

Simple linear regression Multiple linear regression
Model
Predictors one: of them:
Output the response itself the expected value
Estimated form

Start with the simple form when a single predictor does most of the work; move to the multiple form when one predictor leaves too much of the response unexplained.

10.1.2 Coefficient of Determination and Adjusted R Square

Two very important metrics were discussed for judging regression quality. The first is the coefficient of determination, written . It measures the amount of variation in the dependent variable that is explained by the independent variables — or, equivalently, by the estimated regression equation. The value takes care of that proportion-of-explained-variation question. Recall the decomposition of variation from the earlier discussion: the total variation splits into the part the model explains, , and the part left over, , and the coefficient of determination is the explained share:

Because can never exceed , the value of always sits between 0 and 1 — the fraction of the total variation the regression explains.

The second is the adjusted R square. The motivating observation was this: generally speaking, the more independent variables you add, the more increases. Moving from simple to multiple linear regression, you can easily witness going up. But there are situations where you add redundant independent variables — variables that contribute nothing to the dependent variable — and plain does not flag this: its nature is to keep climbing as variables are added. The adjusted is the measure that responds. The moment you add a redundant variable that contributes nothing to the dependent variable, you can see a change in the adjusted .

Worked example: computing adjusted for the Butler Trucking model. With observations and independent variables, suppose the plain comes out as 0.9038. The adjusted multiple coefficient of determination is

Work through the arithmetic step by step:

So after adjusting for the two independent variables, the adjusted coefficient of determination is 0.8763 (87.63% in the software output). Sense-check: the adjusted value is smaller than the plain 0.9038 — the formula penalizes the model for each predictor it uses. If a third variable with no real contribution were added, plain would still climb a little while adjusted would fall or stay flat, which is exactly the redundant-variable behavior the measure exists to expose.

The practical recommendation that followed was strong and unambiguous: whenever you work on regression problems — in course work or in your own analysis — it is always preferable to report the adjusted rather than simply quoting the plain value, because adjusted makes sense even when redundant variables are present.

Exam note: when a regression output is shown, report the adjusted , never only the plain . If an exam asks why the adjusted version exists, the answer is the redundant-variable problem: plain keeps climbing as variables are added, while adjusted responds when a redundant variable enters the model.

10.1.3 Tests of Overall and Individual Significance

Two tests of significance were also introduced in the previous session. Whenever you talk about the overall significance of a regression model — whether simple or multiple — the F test reported in the ANOVA table is the place to look: it tells whether the model as a whole is significant. Alongside that, the t test output tells the individual significance — whether a particular coefficient is contributing to the model on its own. So: ANOVA/F for the model, t for each predictor.

Dimension F test (ANOVA table) t test (output)
Question answered Is the model as a whole significant? Does this one coefficient contribute on its own?
Scope All predictors at once One predictor at a time
Where it appears The regression row of the ANOVA table The coefficient rows of the output
Typical use First check — does the model explain anything? Next check — which predictors pull their weight?

When to pick which: run the F test first to see whether the model explains anything at all; then use the t tests to see which individual predictors matter.

10.1.4 Multicollinearity

The last recap point was the concept of multicollinearity, flagged as a very, very important aspect. The motivating scenario: in practice you are usually not working with two or three variables — you can be working with hundreds of variables in a specific problem, and that is where multicollinearity becomes a real concern.

The idea: we may say we are working on a dependent variable with two independent variables and . But calling them "independent variables" does not mean they are statistically independent.

Worked example: the travel time problem (Butler Trucking). Travel time is the dependent variable . With = miles traveled and = number of deliveries, the two predictors genuinely behave independently — the sample correlation between them is about 0.16 — so each one carries its own information about travel time. Change from "number of deliveries" to "amount of petrol consumed" and the picture flips: now and are no longer behaving like independent variables; both are highly correlated, because a truck that travels more miles burns more petrol. The second model would hold two predictors that keep saying the same thing. Sense-check: the same two-slot model is fine with the first predictor pair and redundant with the second — the correlation structure of the predictors, not their names, decides whether multicollinearity is a problem.

What happens when many highly correlated variables enter a model? You cannot get any extra information from including those related variables. So it should be avoided. The fundamental measure used to detect the problem is the correlation coefficient: you take the correlation matrix (correlation coefficient matrix) for all 100 variables, or however many there are, and you look for pairs of variables that are highly correlated — highly dependent. If such a pair exists, you retain only one of them, or , depending on your problem: even if you add the other variable, you are not going to fetch any new information.

As a working rule, statisticians have settled on a threshold: at about 0.7, you can say a potential multicollinearity problem exists among those variables, and you should attempt to redefine your problem or redefine the model by retaining few variables and eliminating the rest.

A classic symptom of multicollinearity: the F test says the model is significant, but the individual t tests say none of the coefficients is significant. That happens when the predictors are so intertwined that, with the others already in the model, no single variable looks indispensable. The model is not necessarily wrong; the data simply cannot separate the effects of the correlated predictors. The fix is the same as above — keep one variable from each correlated pair.

Recap: the regression toolkit from the previous session has four parts — the model forms (simple and multiple), the fit measures ( and adjusted , report the adjusted one), the significance tests (F for the model, t for each predictor), and the multicollinearity check (correlation matrix, drop one of any pair correlated beyond about 0.7). The session now builds on this base: first checking the model's errors, then handling categorical predictors, and finally replacing the whole model when the dependent variable itself is a 0–1 outcome.

This is where the toolkit matters in practice: in credit scoring, marketing analysis, and any field where models start with hundreds of candidate predictors, checking the correlation matrix for pairs beyond 0.7 is a standard early step before any model building. In data-heavy settings, correlated predictors are the rule rather than the exception, so this recap is not a formality — it is the foundation the rest of the session assumes.

10.2 Residual Analysis: Judging a Model by Its Errors

10.2.1 The Regression Model and the Residual

Hook: A software output tells you the fitted equation, , and the significance tests. Is that enough to trust the model? The answer is no — the numbers alone never tell you whether the assumptions behind them actually hold. That is the job of the plots.

The agenda for this session started with a point about how conclusions should be substantiated. Numerical justifications and outputs are one way to address the appropriateness of a model — simple or multiple — but it is always recommended to infer, apart from the analysis-of-variance output, with the help of plots. The same logic that works for simple linear regression carries over to multiple regression along similar lines.

Recall the model: , fitted as . The residual is the difference between the observed value and the predicted value:

In words: the residual for observation is "the observed value minus the predicted value." It is the vertical gap between the data point and the fitted line — the part of that observation the model could not explain. The observed value is the actual measurement for observation ; the predicted value comes from plugging that observation's into the fitted equation.

The residual is the raw material of every diagnostic plot. If the residual is zero, that is a perfect fit: there is no deviation to expect. Two properties follow from the way the fitted line is built by least squares:

  • The residuals of an intercept-containing fitted model always sum to zero, . Positive and negative deviations balance out, so the line passes through the middle of the cloud of points.
  • A small, structureless scatter of residuals around zero is the signature of a well-behaved model; a systematic pattern in that scatter means the model is missing something.

There is an important attitude point here: getting the output is one aspect, and discussing it further is another. In Excel or SPSS outputs, all these plots can be produced with a single click — but producing the output is not the same as interpreting it. The click is the easy part; looking at the plots, checking them against the known patterns, and justifying the assumptions is the part that carries the analysis.

Pitfall — the single-click trap: the software will happily print every residual plot and every other diagnostic chart at the click of a button. A chart printed does not equal an assumption justified. Marks (and good practice) come from comparing each plot with the standard patterns and stating what the comparison shows — never from attaching a stack of unread output.

10.2.2 The Error Assumptions

Beyond fitting the model, there is a very important discussion to carry out: the error analysis. It fetches clarity into the entire discussion. The assumptions on the error term are:

In words: "the expected value of epsilon is zero," and "the variance of epsilon is sigma square" — the amount of variation is constant, which is what we call homogeneity of variance (the technical name is homoscedasticity). There are situations where the variance is not constant — that condition is called heteroscedasticity — but that was named and deferred, not developed.

The third assumption completes the set: the errors should behave independently and identically distributed with the normal distribution:

Reading the assumption formula. The single line packs three claims into one:

  1. Mean zero. On average the error is zero, so the line is not systematically too high or too low.
  2. Constant variance. Every observation carries the same amount of scatter around the line, whatever the value of . This is the homoscedasticity assumption.
  3. Independence and a normal error distribution — the errors are independent of each other (knowing one error tells nothing about the next) and each follows a normal distribution with mean 0 and variance .

So the error analysis justifies three things: (1) the errors have mean zero, (2) they capture an equal amount of variation (constant variance), and (3) they follow a normal distribution. To justify these aspects, different plots are available — all visible in Excel and SPSS outputs. Two plots address the homogeneity of variance aspect: the residual plots. Two more plots capture the information that the error follows a normal distribution. Many such justifications are required before suggesting a specific model and making conclusions.

Assumption Plot that justifies it
Constant variance (homoscedasticity) Residual plot against ; residual plot against
Errors follow a normal distribution Two more plots, covered in the next two subsections

10.2.3 Residual Plots, the Pizza Example, and the Three Classic Patterns

The running example for this part was the Armand's Pizza problem used earlier in the discussion of the coefficient of determination, where the complete variation was decomposed into its parts. The fitted line there was:

In words: "y hat is something like 60 plus 5x." Here is the size of the student population (in thousands) around a pizza parlor and is the quarterly sales (in thousands of dollars); a parlor in an area of thousand students is predicted to sell thousand dollars of pizza per quarter. The residual for any observation is the observed value minus the predicted value, and a zero residual means a perfect fit with no deviation.

Worked example: the residuals of the pizza model, computed in full. Ten pizza parlors gave the following data. For each parlor, compute the predicted value from , then the residual :

Parlor (students, 1000s) (sales, 1000s dollars)
1 2 58 58 − 70 = −12
2 6 105 105 − 90 = 15
3 8 88 88 − 100 = −12
4 8 118 118 − 100 = 18
5 12 117 117 − 120 = −3
6 16 137 137 − 140 = −3
7 20 157 157 − 160 = −3
8 20 169 169 − 160 = 9
9 22 149 149 − 170 = −21
10 26 202 202 − 190 = 12

Sense-check: add the residuals — . The residuals balance exactly around zero, as expected for a least-squares line with an intercept. Small negative and positive values of similar size scatter around the fitted line; no parlor's error is enormous relative to the others.

For this problem two residual plots were drawn. The first plots the residual against the independent variable . The second plots the residual against the predicted values . Both plots convey information about the constancy of the variation. (In simple regression the two plots show the same pattern, so either one can be used; in multiple regression, where there are several 's to choose from, the plot of residuals against the predicted values is the one more widely used.)

Visual intuition. Imagine a scatter diagram whose horizontal axis is (students in thousands) and whose vertical axis is the residual (in thousands of dollars of sales). Draw a horizontal reference line through zero. The ten points scatter above and below that line: the first point sits at , (below the line), the second at , (above the line), and so on. The landmark to look for is the band: the points should form a roughly horizontal, shapeless band of about the same width at every . That is what the pizza residual plots look like — no widening, no curve. Takeaway: the residual band hugs the zero line with constant width, which is the picture of constant variance.

In these plots there is a central line representing zero residuals: points above the line are positive residuals, points below it are negative residuals. On a raw plot alone you may not be able to conclude anything — which is why the discussion compared the plots against the three patterns that generally appear in residual studies:

  • Panel A — constant variation: there is no unusual pattern. When your residual plot looks like this, you have a good pattern: the assumption is being taken care of.
  • Panel B — as increases, the variation keeps increasing (a funnel shape). Here there is no constant variation: the assumption of constant variance is not supported — a heteroscedasticity-type problem.
  • Panel C — a completely different pattern, where the observations behave like a curvilinear curve: this signals a curvilinear specification problem — the linear form itself is wrong.

The three patterns and what each one means. Panel A is the goal: a shapeless horizontal band of residuals means the constant-variance assumption survives. Panel B is the funnel — the band widens as grows, so variance grows with and the constant-variance assumption fails. Panel C is the curve — the residuals bend, which says the relationship is not linear in the first place; a curvilinear or otherwise different model form is needed. Panel C is the easiest to misread: the pattern is not about variance at all but about the wrong model shape.

The conclusion for the pizza problem: both residual plots resembled Panel A, which justifies that the appropriateness of the regression model holds. Along with , adjusted , and the significance procedures, the residual plots give an idea of model quality — this is what one must know about residual plots.

10.2.4 Standardized Residual Plots

The next pair of plots addresses the normality assumption. Heavy calculations had been done (by the software) to produce them, and the discussion is deliberately visual: no theoretical depth, just inspection.

The standardized residual plot draws the standardized residuals against . A standardized residual is the residual divided by its standard deviation: since the mean of the residuals is zero, standardizing means simply dividing each residual by its standard deviation,

where is the estimated standard deviation of residual . The key fact to know: if all the standardized residuals lie between +2 and −2, you have a reliable justification that the errors follow a normal distribution.

Why the +2 to −2 rule works — the empirical rule. For a normal distribution, about 68% of the observations lie within one standard deviation (one sigma) of the mean, about 95% lie within two sigma, and almost all — about 99% — lie within three sigma. A standardized residual is already measured in sigma units, so if the errors were normal, roughly 95% of the standardized residuals should fall between −2 and +2. When the plot against shows every observation inside the +2 to −2 band, the normality assumption looks right. By just looking at these plots one can sense that the epsilons follow a normal distribution.

Visual intuition. Horizontal axis: the independent variable . Vertical axis: the standardized residual, which carries no units (it is measured in standard deviations). The chart is framed by two horizontal landmark lines at +2 and −2. Points should sit inside the frame, scattered around zero, with no points breaking out beyond the lines and no funnel or curve. Takeaway: an all-inside-the-frame scatter is the visual fingerprint of normal errors.

10.2.5 Normal Probability Plots

On a similar note, the normal plot — also called the QQ plot (quantile-quantile plot) — is the companion check. All the observations should be clustered towards the line drawn at around a 45-degree angle. If everyone is very close to that line, with no huge variations, then this visual trait also explains that the error follows a normal distribution.

Visual intuition. The QQ plot pairs each ordered standardized residual with the value it would take if the data came from a normal distribution (the normal score). Plot the normal scores on the horizontal axis and the standardized residuals on the vertical axis. If the residuals are normal, the points fall close to the 45-degree line through the origin — the line where observed equals expected. Substantial curvature away from the line, or points straying far from it, is evidence against normality. Takeaway: points hugging the 45-degree line mean the normal assumption holds; systematic curvature means it does not.

The overall message: this error analysis gives sound clarity before you present any specific report, and the same logic prevails for multiple regression as well.

Recap: a regression conclusion rests on four visual checks — the residual plot against and the residual plot against (both for constant variance, comparing with Panel A/B/C), the standardized residual plot (all values between +2 and −2), and the normal probability plot (points close to the 45-degree line). The last two support the normality of the errors. These checks apply to simple and multiple regression alike, and they must be done and justified before the model is presented — in course work and in any applied report.

10.2.6 Where to Read More

For more detail, the textbook reference is: sections 14.8 and 15.8 (chapter 14, section 8, and chapter 15, section 8) contain the discussions of these residual plots, worked out in detail with the full problem discussion. If you want more insights on residual analysis, go through those specific sections.

10.3 Qualitative Independent Variables: Dummy Variables

10.3.1 The Johnson Filtration Problem

Hook: Everything so far assumed every predictor is a number — months, miles, dollars. But what if one predictor is a category, like the type of repair? The Johnson Filtration maintenance service problem shows how to bring such categorical information into a regression model.

The multiple linear regression discussion so far serves the purpose when all predictors are numeric — but what if one of them is categorical? The Johnson Filtration problem was the vehicle for this. Johnson provides a maintenance service for water filtration systems throughout southern Florida. Customers contact Johnson with requests for maintenance service on their water filters. The Johnson manager wants to predict the repair time necessary for each maintenance request.

So the repair time in hours is the dependent variable, . It is believed to be related to two factors: (1) the number of months since the last maintenance service, written MSLS, which is called ; and (2) the type of repair — which may be electrical or mechanical — called . The data table showed 10 service centers, with the months since last service and the repair times in hours.

With these quantifications in hand, a simple linear regression using only the months since last service would serve the purpose — is a quantitative independent variable. But is not quantitative: the type of repair carries no numbers, and no numerical quantification exists for it. If you go with simple linear regression alone, you are simply ignoring the type-of-repair information entirely — the whole piece of information is useless to the model, even though it contributes to repair time.

10.3.2 Coding a Categorical Variable as a Dummy

How do you include a categorical (qualitative) independent variable such as type of repair in a multiple linear regression? The approach: you decode or code the categories with numbers. For this example, electrical repairs are coded as 1 and mechanical repairs as 0. The entire column is renamed into a sequence of ones and zeros — wherever an electrical repair is there, the entry is 1; otherwise 0. This is what is called the dummy variable concept.

What a dummy variable is. A dummy variable (also called an indicator variable) is a variable that takes only the two values 0 and 1 to stand for a category: 1 means "this category is present", 0 means "this category is not present". The coding for the Johnson data is

With this coding, the ten service calls in the data carry the values of shown below, and the whole problem becomes numeric — ready for multiple linear regression.

Service center Months since last service () Type of repair () Repair time in hours ()
1 2 1 (electrical) 2.9
2 6 0 (mechanical) 3.0
3 8 1 (electrical) 4.8
4 3 0 (mechanical) 1.8
5 2 1 (electrical) 2.9
6 7 1 (electrical) 4.9
7 9 0 (mechanical) 4.2
8 8 0 (mechanical) 4.8
9 4 1 (electrical) 4.4
10 6 1 (electrical) 4.5

The choice of 1 and 0 was made purely for ease of explanation. You could equally use 1 and 2, or 3 and 4 — but then you would have to interpret accordingly. The point: whenever you involve qualitative independent variables, code them with numbers; the combination of 1 and 0 keeps the interpretation simple, with 1 standing for "there exists an electrical repair" and 0 for a mechanical repair.

Pitfall — the general coding rule: a categorical variable with categories needs dummy variables, each coded 0 or 1. The Johnson example works with a single dummy only because there are two categories (electrical and mechanical). With three repair types you would need two dummies, with four types three, and so on — one category always acts as the reference case coded by all zeros.

10.3.3 The Estimated Regression Equation

With the problem transformed, the multiple linear regression becomes:

In words: "b0 plus b1 x1 plus b2 x2," where is MSLS and is the coded type of repair. The discussion compared two outputs: one that ignores the type of repair (because at first you do not know what to do with it) and one that includes the coded variable — and you can see the increasing in the second output, the behavior already expected from the discussion. In the book's output for this problem, jumps from about 53% with only the months variable to about 86% once the type of repair is added — the categorical information earns its place in the model.

The fitted equation used for interpretation was:

In words: "y hat is 0.9304 plus 0.3876 times MSLS plus 1.26 times the type of repair."

Exam note: this is exactly the kind of fitted output you will see in exam problems — you are given the estimated regression equation from an output and asked to analyze it. For example, an output may present an equation in the form with the digits as they appear in the output, and the task is to write the estimated regression equation and interpret the coefficients.

10.3.4 Interpreting the Two Models

This is where interpretation demands care, because the categorical predictor splits the fitted equation into two specific models. Whenever you want to talk about an electrical repair, replace with 1; for a mechanical repair, replace with 0.

  • Mechanical repair (): the problem collapses to the simple linear form, . Numerically:

  • Electrical repair (): the whole problem becomes . Numerically:

Worked example: predicting repair time with the two equations. Suppose a service call arrives 4 months after the last maintenance (). For each repair type, plug in the value of and the coded :

Mechanical repair ():

Electrical repair ():

Sense-check: the two predictions differ by hours — exactly the coefficient (up to rounding). The slope contributed the same 1.5504 hours of growth in both cases; the whole gap between the two repair types is the intercept shift . On average, an electrical repair takes about 1.26 hours longer than a mechanical repair at any value of .

Carefully observing these two equations gives the key impressions:

  • The slope is the same in both contexts — whether mechanical or electrical, there is no change in the slope. Thinking of the line , where talks about the slope and talks about the intercept: the slope does not change across repair types.
  • The intercept changes: for mechanical repair it is ; for electrical repair it is . So the coefficient is what separates the mean repair times of electrical and mechanical repairs.

The coefficient drives the conclusion about mean repair times:

  • If is positive: the mean repair time for an electrical repair will be greater than the mean repair time for a mechanical repair.
  • If is negative: the mean repair time for an electrical repair is less than the mean repair time for a mechanical repair.
  • If : there is no difference between the repair times across the two types.

Pitfall — do not read a dummy coefficient like a quantitative one. The way you interpret the coefficients is slightly different when the model involves qualitative independent variables — you cannot read the way you would read the coefficient of a quantitative predictor. A quantitative coefficient says "a one-unit rise in moves the prediction by units". A dummy coefficient says nothing about slope; it says only that the category coded 1 sits units above the reference category coded 0, at every value of the quantitative predictor. The sign of is the whole conclusion.

10.3.5 What the Graph Shows

Visual intuition. Draw a scatter plot with months since last service () on the horizontal axis and repair time in hours () on the vertical axis. Mark each mechanical repair with an M and each electrical repair with an E. Superimpose the two fitted lines: the mechanical line and the electrical line . Both rise with the same slope , so the lines are parallel; the electrical line sits everywhere hours above the mechanical line. The landmarks: on the vertical axis the mechanical line starts at 0.93 and the electrical line at 2.19 — a vertical gap of 1.26 that holds at every value of . Takeaway: the entire difference between the two categories is captured in the shift of the intercept.

Graphically, the two fitted lines are parallel: the same slope with a vertical separation of between the mechanical line (intercept ) and the electrical line (intercept ). The entire difference between the two categories is captured in the shift of the intercept.

10.3.6 Exam Notes

Exam note — the dummy variable checklist:

  • Expect exam problems that present a fitted regression output (an equation like in the output, digits as given) and ask you to analyze it — write the estimated regression equation and interpret the coefficients.
  • For dummy variables, know the two-model split (category coded 1 vs. category coded 0), the fact that the slope stays the same and only the intercept shifts, and how the sign of directs the conclusion about mean values: positive means the coded category has the higher mean, negative means the lower mean, zero means no difference.
  • Remember the recap guidance: report adjusted , use the ANOVA F test for overall significance and the t test for individual significance.

This is where the dummy-variable trick pays off in practice: repair-time prediction for maintenance fleets, customer-service planning, and any industry model that mixes numeric drivers with categorical factors (machine type, region, shift, supplier). Categorical predictors are everywhere in applied work, and the dummy coding shown here is the standard way to give the model access to them.

10.4 Logistic Regression: When the Dependent Variable Is Dichotomous

10.4.1 Why Linear Regression Fails for Zero–One Outcomes

Hook: So far every dependent variable we modeled was a measurement — sales, repair hours, travel time. But what if the question is simply "approved or rejected?", "spam or not spam?" — an answer that takes only two values? The whole toolkit of the last two sessions stops working, and this section explains why.

So far the analysis covered multiple linear regression with quantitative variables, and then the dummy-variable extension for a categorical independent variable. But there are situations where the dependent variable itself is categorical — a dichotomous response that takes only two possible values, 0 and 1.

If you apply simple or multiple linear regression to such a , the predictions can exceed the range of 0 and 1 — may come out more than 1 or less than 0 — and that is completely meaningless when takes only the values 0 and 1. Linear regression is simply not helpful here, and this is not advisable. Because of this behavior of the dependent variable, the old reading of a coefficient also fails: "a one-unit increase in will change by " is not the way to talk about these models. Everything is better interpreted in terms of probabilities instead.

Why a straight line cannot model a 0–1 response. The fitted line extends over all real values. With a dichotomous , that line will inevitably cross outside the only meaningful range — for some observations the prediction lands below 0 (a negative probability, nonsense) and for others above 1 (a probability above certainty, also nonsense). Even when the line stays inside the range, a straight line says the probability changes by a constant amount per unit of , which cannot stay within over all . A curve that is forced to live between 0 and 1 is what the situation needs.

10.4.2 Real Examples: Credit Card Approval and Spam Detection

Two motivating situations were given. First, a credit card request: whether the bank approves the credit card or rejects it — the decision takes only two possible values, approving or rejecting, so is mapped to 0 and 1. Second, spam detection: whether a given email is spam or not — again takes two values, with many factors modeled against it. These days logistic regression is also used as a classification technique.

The summary rule: logistic regression is the appropriate regression analysis to conduct when the dependent variable is dichotomous. Like all regressions it is still a predictive regression, but some mathematical violations are expected in it — which is exactly why a different expression is needed and why the interpretation cannot run the same way.

Real-world: credit card approval decisions and email spam filtering are everyday classification problems solved with this approach. The pattern generalizes: loan default (default / no default), disease screening (positive / negative), churn prediction (leaves / stays) — any yes–no outcome modeled from a set of predictors.

10.4.3 The Logistic Regression Equation

The expression used to capture this zero–one behavior is the sigmoidal function — the S-shaped curve you observe between 0 and 1. The logistic regression equation is:

In words: "e power beta 0 plus beta 1 x1 plus beta p xp, divided by 1 plus e power beta 0 plus beta 1 x1 plus beta p xp." Here denotes the probability of the positive outcome, and the term in the exponent is the linear combination of the predictors. Whenever you are asked to write a logistic regression equation, you should express everything in this form.

Building the formula step by step. The linear combination can be any real number — positive, negative, zero. The exponential is always positive: as grows, grows without bound; as sinks, shrinks toward zero. Now examine the two limits of the fraction :

  • as : dominates, approaches (the fraction tends to );
  • as : collapses toward 0, and the fraction approaches .

So the expression can never leave the interval no matter how extreme the predictors are. That is exactly why the exponential appears: it converts an unrestricted linear combination into a number that behaves like a probability. The formula is not new arithmetic layered on the old model — it is the same linear structure, wrapped so that its output is forced into the 0–1 range the response lives in.

If there is only one independent variable, the expected value ranges from 0 to 1, and the S-shaped expression best suits that behaviour: as the value of keeps increasing, you approach 1; and in the other direction, you approach 0.

Visual intuition. Horizontal axis: the single independent variable . Vertical axis: , the probability of the positive outcome, scaled from 0 to 1. The curve is a stretched S: it runs nearly flat near 0 for small , climbs steeply through the middle, then flattens again near 1 for large . Its landmarks are the two horizontal asymptotes — and — which the curve approaches but never touches. For the parameter values , , the curve gives about 0.02 at , about 0.27 at , and about 0.88 at — the steep middle stretch is where a small change in changes the probability a lot. Takeaway: the S-curve is the probability shape — bounded by 0 and 1, steepest in the middle.

Where the model's behavior differs from linear regression. In a linear model, every unit step in moves the prediction by the same fixed amount, forever. In the logistic model the effect of a step in depends on where you are on the S: near the middle, a step changes the probability strongly; near the ends, the same step barely moves it. This is a deliberate consequence of forcing predictions into , not a flaw.

The mathematical aspects — why we take this exponential function and how it takes care of the zero–one values — were flagged as a point to be developed in the next session.

Dimension Linear regression Logistic regression
Output anywhere on the real line forced between 0 and 1
Shape straight line S-shaped (sigmoidal) curve
Dependent variable continuous measurement dichotomous, 0 or 1
Reading a coefficient "one-unit rise in changes by " does not apply — probabilities and odds take over
Estimation least squares maximum likelihood (software)

When to pick which: use linear regression for a continuous response; switch to logistic regression the moment the response is a 0–1 outcome.

10.4.4 The Expected Value as a Probability

The single most important interpretive principle: in logistic regression the expected value is always interpreted as a probability. Precisely:

In words: the expected value of given the set of independent variables is the probability that equals 1 given those variables. Every subsequent discussion in logistic regression — everything involving the p values and probability values — rides on this identification. Even the very basic expression of the expected value itself already indicates that it is talking about the probability that given the set of independent variables.

Why equals a probability for 0–1 data. With taking only the values 0 and 1, the expected value is

The 0-term vanishes and the 1-term is exactly the probability of the positive outcome. So in logistic regression the expected value is a probability, and every coefficient, prediction, and managerial conclusion must be read in probability language.

10.4.5 Student Questions and Answers

Q: Is the sigmoidal function representing the probability that y equals 1 given the value of x?

A: Yes. For a single independent variable the expected value ranges between 0 and 1, and the sigmoidal expression is the one that best suits that behaviour. The mathematical derivation of the exponential terms and why they are needed will follow in the next session.

10.5 The Simon's Coupon Example: Fitting Logistic Regression in R

10.5.1 The Data

The worked example came from the book: a catalog retailer (called Simon's in the discussion; the book names it Simmons Stores), which runs a national chain of women's apparel stores, tracked whether customers used the coupon they received. The full data file has 100 customers; only the sample of the first 10 catalog recipients was shown for illustration, and the same data file was promised to be shared.

The variables to keep track of — relate , , and to these descriptions in all further discussion:

  • — the coupon column: 1 indicates the customer used the coupon, 0 indicates the customer did not use the coupon. This is the dependent variable.
  • — the amount spent at Simon's last year, in thousand dollars (annual spending).
  • — the credit card information, coded as 0 and 1 (whether the customer has a credit card: 1 = has, 0 = does not).

The first ten rows of the data, exactly as they appear in the book:

Customer Annual spending (1000s dollars) Credit card Used coupon
1 2.291 1 0
2 3.215 1 0
3 2.135 1 0
4 3.924 0 0
5 2.528 1 0
6 2.473 0 1
7 2.384 0 0
8 7.076 0 0
9 1.182 1 1
10 3.345 0 0

For a model with these predictors, the multiple linear regression form will not serve the purpose: is not continuous, it takes only 0 and 1, and the linear predictions can exceed 1 or fall below 0. So everything is expressed in terms of probabilities, and the logistic regression equation takes over.

10.5.2 The R Workflow

The demonstration was run live in R, because the data file was not at hand at that moment. The steps, exactly as shown:

data <- read.csv(file.choose(), header = TRUE)
fit <- glm(y ~ x1 + x2, data = data, family = binomial)
summary(fit)

What each line does.

  • read.csv(file.choose(), header = TRUE) — when you deal with data in R you should convert the Excel file into a CSV file first and then read it; file.choose() opens a dialog so you can pick the CSV interactively, and header = TRUE tells R the first row holds the variable names. The result is stored in a data object (named data here; the live demo used another name for the same idea).
  • glm(y ~ x1 + x2, data = data, family = binomial) — the glm function (generalized linear model) fits the model. The formula y ~ x1 + x2 declares the dependent variable against the two independent variables; data = ... passes the data object; family = binomial is the argument that handles the dichotomous zero–one response — it tells R to use the logistic form.
  • summary(fit) — prints the entire output, including the fitted coefficients.

Inputs and outputs. Inputs: the CSV data frame with columns , , , plus the choice of family (binomial). Output: the fitted coefficient estimates together with standard errors, tests, and deviance measures.

The live demo used 10 sample observations, while the full output discussed came from the complete 100-observation file.

Software reality check: Excel does not have a complete built-in logistic regression output (as far as is known), while R and SPSS give the direct outputs. If your work environment is Excel-based, export the sheet to CSV and move to R (or use SPSS) for the logistic fit. The family = binomial setting is the detail that changes an ordinary regression command into a logistic one.

10.5.3 The Fitted Equation

From the output, the fitted coefficients were read off directly:

Because this is a logistic regression, the estimated regression equation is written in the exponential form, replacing with the fitted values:

In words: "e power b0 plus b1 x1 plus b2 x2 over 1 plus e power b0 plus b1 x1 plus b2 x2," with the coefficients replaced by the numbers above. At this point the equation was merely written down; the interpretation of the coefficients — what they contribute — was the next step.

Worked example: substituting the fitted coefficients into the equation. The estimated probability that a customer uses the coupon is

Now evaluate it for two customer types.

Customer A — spends 2000 dollars and has no credit card (, ):

Customer B — spends 2000 dollars and has a credit card (, ):

Sense-check: both probabilities land inside [0, 1] as the logistic form guarantees. The two customers differ only in , and the estimated probability of using the coupon rises from about 0.19 to about 0.41 — card holders look far more likely to use the coupon. These are exactly the managerial comparisons the logistic output is built to answer, though the formal coefficient interpretation (via odds) comes in the next session.

10.5.4 Reading the Output Differently

The key caution for this problem: the coefficients will not give you the direct information they give in linear regression. There, a one-unit increase in influences in a directly readable way; here, the same logic does not work because of the probability-based behaviour of the dependent variable. With logistic regression you need much more careful observation to conclude anything about the predictors.

The discussion previewed what comes next: odds and the odds ratio — the concepts that will carry the interpretation of and — along with the basic interpretations that are very much required and very much different from ordinary regression concepts. The managerial questions posed for the Simon's problem will be answered from this perspective.

Intuition: in linear regression the coefficient is the direct answer — "raise by one and moves by ". In logistic regression the coefficient acts inside the exponent, so its effect on the probability depends on where the probability already is (the S-curve again). Reading the output so needs a different vocabulary — odds and odds ratios — which is exactly what the next session develops.

10.5.5 Student Questions and Answers

Q: What exactly is odds in the statistical perspective?

A: We will discuss odds and the odds ratio extensively in the next session. For now, keep in mind that the interpretation of the coefficients b1 and b2 is very different from what you do in linear regression.

10.6 A Real Research Application: Consanguinity and Autism Spectrum Disorder

10.6.1 The 2014 Short Report

Before the technical treatment of logistic regression, a personal research experience was shared as motivation — a short report published in 2014 in a peer-reviewed periodical (a Wiley publication; the journal name did not come through exactly in the discussion, but the report itself was shared for reference). The point of the story: even a research team could rely on the very technique being introduced today, mapped onto a real medical question.

The research concerned autism spectrum disorder, a disorder in kids, and its association with consanguinity in India — the question of whether parents being related to each other (for example, cousins) is associated with autism in the child. Consanguinity (from "con-" meaning together and "sanguis" meaning blood) refers to a biological relationship between the parents; the study asked whether that family structure changes the odds that a child develops the disorder. The team was interdisciplinary: biology faculty, a mathematician, and some doctors. One researcher, while pursuing her PhD, had carried out research on the autism spectrum in the context of India.

The statistical work used — at that point in time — simple logistic regression: many factors were considered, and whether the individual child has consanguinity or not, and other such attributes, were mapped to dichotomous values and regressed against the different factors, exactly in the spirit of the current discussion. The team substantially justified the discussion and proved the association with consanguinity, which was anyway true.

Real-world: this is logistic regression applied in medical and epidemiological research — mapping a dichotomous health outcome (child has the disorder: yes or no) to risk factors (consanguinity, family history, and others). The outcome is a 0–1 variable, so logistic regression is the natural tool. Nowadays more advanced techniques exist, but the mapping logic is the same one being learned here: code the outcome 0 and 1, collect the factors, fit the S-shaped model, and read the result in probabilities.

10.7 Roadmap for the Next Session

10.7.1 Odds, Odds Ratios, and Interpretation

The next session will continue with the Simon's credit card problem from this juncture: the basic concepts, properties, and interpretations of the coefficients — how odds and the odds ratio matter and how they will be addressed. The managerial questions posed for the problem will then be answered. The discussion was expected to take about half an hour to forty minutes.

Where we stand: the fitted logistic equation for the coupon problem is written and evaluated, but its coefficients still cannot be read the way linear-regression coefficients are read. The bridge to interpretation is the odds — the probability of an event divided by its complement — and the odds ratio, which will translate and into statements managers can act on.

10.7.2 Dimensionality Reduction: PCA and LDA

After the interpretation of logistic regression, the focus will shift to two dimensionality-reduction techniques: principal component analysis (PCA) and linear discriminant analysis (LDA). An element of linear algebra will be required — eigenvalues and eigenvectors will come into the picture, especially for PCA. The view offered: to understand these reduction techniques, linear algebra gives much more insight than merely calculating. Because of the non-mathematics background of many in the audience, the material will be framed so that it is neither too mathematical nor too far away from mathematics.

Exam Guidance Summary

Mid-semester paper. The evaluation of the mid-semester scripts is underway. The key (solutions with the marking scheme) will be shared by Monday — go through it, relate it to your marks, and raise any queries. If you feel a correct answer was not credited, that is what a rechecking request is for. The framing came from the two types of error in hypothesis testing: if the question is correct and zero is awarded, that is one error committed; if the question is wrong and marks are awarded, that is the other error. Both errors are being taken care of; scripts submitted by mail will also be considered. The sample-size determination problem in quiz one reportedly had a wrong option — for that particular problem, the majority will get credit for that point.

Q: I have a doubt about the notation for a right tail problem: the area to the right of Z alpha was represented as 0.024, so should the critical value be taken on the other side of the distribution?

A: No. For the right tail problem the critical value is positive, about 1.97, and the area to the right of that value is the significance level, which is 0.024. The earlier view was looking at the left side of the distribution instead, which is not what the notation refers to.

Quizzes. Each quiz allows only one attempt; no further attempts are allowed. A huge duration is given, so complete the quiz within the stipulated time.

Assignment. The assignment component works in groups: groups of 7 to 10 (the total strength is around 400–440, so the final size will depend on how many turn up), a very basic dataset, a simple analysis, and a single report submitted as a whole team. There is not much variation in what can be expected, since everyone performs at their own level — the best you present, the best credits you get. A drive link will be shared where each group adds the ID numbers so the marks can be reflected for the entire group.

Q: Is forming our own groups, working on a basic dataset, and submitting a single report as a whole team a good way to do the assignment?

A: Yes, that works well. You will form groups of 7 to 10, get a very basic dataset, do a simple analysis, and submit one report as a whole team. I will share a drive link where you add your ID numbers so the marks can be reflected for the entire group.

Exam content signals. For the exam, expect fitted regression outputs that you must analyze — an estimated equation like given in the output (digits as they appear in the output), with the task of writing the regression equation and interpreting the coefficients. For regression work, remember: report adjusted rather than plain ; use the ANOVA F test for overall significance and the t test for individual significance; check residual plots against the three classic patterns (Panel A constant variance, Panel B increasing variance, Panel C curvilinear); standardized residuals within +2 to −2 and normal plot points close to the 45-degree line support the normality assumption; and for dummy variables, know that the slope stays the same while the intercept shifts by the dummy coefficient.

Key Industry Applications

  • Real-world: Johnson Filtration — a maintenance service for water filtration systems throughout southern Florida — predicts repair time in hours from months since last service and type of repair (electrical vs. mechanical), using a dummy variable.
  • Real-world: Simon's catalog coupon targeting — predicting from spending and credit card status whether a customer will use a coupon (dichotomous ), modeled with logistic regression in R.
  • Real-world: credit card approval decisions — approve or reject, a two-decision problem mapped to 0 and 1.
  • Real-world: spam detection — classifying an email as spam or not spam; logistic regression used as a classification technique.
  • Real-world: medical/epidemiological research — the 2014 short report on consanguinity and autism spectrum disorder in India, which used simple logistic regression to map dichotomous outcomes to risk factors.
  • Real-world: software practice — logistic regression is fit directly in R (the glm function with family = binomial) and SPSS; Excel has no complete built-in logistic output; Excel data should be converted to CSV before reading into R.
  • Reference: textbook sections 14.8 and 15.8 contain the detailed residual analysis discussion.

ASM Lecture 10 notes · Residual Analysis, Dummy Variables, and Logistic Regression

Advanced Statistical Methods· postgraduate· 2026-08-11

Sections Breakdown

1Regression Recap: The Toolkit from the Previous Session

The model forms (simple and multiple linear regression), least-squares fitting, the coefficient of determination and adjusted R-square, the F and t significance tests, and the multicollinearity check with the 0.7 correlation rule.

2Residual Analysis: Judging a Model by Its Errors

The residual as observed minus predicted, the error assumptions of zero mean, constant variance and normality, the pizza example, the three classic residual-plot patterns, standardized residuals within +2 and -2, and the normal probability (QQ) plot.

3Qualitative Independent Variables: Dummy Variables

The Johnson Filtration repair-time problem, coding a categorical variable as a 0/1 dummy, the estimated equation, the two parallel models with the intercept shift b2, and how the sign of b2 decides the mean comparison.

4Logistic Regression: When the Dependent Variable Is Dichotomous

Why linear regression fails for zero-one outcomes, credit card approval and spam detection as motivating examples, the sigmoidal logistic equation bounded by 0 and 1, and the expected value as the probability that y equals 1.

5The Simon's Coupon Example: Fitting Logistic Regression in R

The coupon data (100 customers, first 10 shown), the R workflow with read.csv, glm and family = binomial, the fitted equation with coefficients -2.146, 0.3416 and 1.0987, evaluated probabilities, and why the coefficients are not read like linear ones.

6A Real Research Application: Consanguinity and Autism Spectrum Disorder

A 2014 short report on autism spectrum disorder and consanguinity in India, showing simple logistic regression mapping a dichotomous health outcome to risk factors.

7Roadmap for the Next Session

Odds and the odds ratio as the bridge to interpreting logistic coefficients, followed by principal component analysis and linear discriminant analysis with eigenvalues and eigenvectors.

8Exam Guidance Summary

Mid-semester paper updates, the Z alpha right-tail Q&A, quiz and assignment rules, and the exam content signals: fitted regression outputs, adjusted R-square, F and t tests, residual-plot patterns, and dummy-variable interpretation.

9Key Industry Applications

Repair-time prediction with dummy variables, coupon targeting with logistic regression in R, credit card approval, spam detection, medical research, software practice, and the textbook references.

Postgraduate students in Advanced Statistical Methods

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

Regression Recap: The Toolkit from the Previous Session

Must-know: Report adjusted R^2 rather than plain R^2 (it responds when redundant variables are added); ANOVA F test covers overall significance, t test covers individual significance; check the correlation matrix and keep one of any predictor pair correlated above about 0.7.

⚠️ Top pitfall: Quoting plain R^2 even when redundant variables are present; keeping both members of a highly correlated predictor pair; expecting t tests to stay significant when predictors are multicollinear.

Self-check: Why does plain R^2 keep climbing as variables are added while adjusted R^2 responds to a redundant variable? What threshold signals potential multicollinearity?

Connects to: Residual Analysis: Judging a Model by Its Errors, Qualitative Independent Variables: Dummy Variables, Logistic Regression: When the Dependent Variable Is Dichotomous

Residual Analysis: Judging a Model by Its Errors

Must-know: Residual = observed minus predicted; errors assumed E(eps)=0, Var(eps)=sigma^2 (homoscedastic), i.i.d. normal; residual plots vs x and vs yhat compare with Panel A (constant variation), Panel B (funnel, variance increases), Panel C (curvilinear, wrong specification); standardized residuals within +2 to -2 and normal plot points near the 45-degree line support normality.

⚠️ Top pitfall: Printing the plots with a single click without interpreting them; reading Panel C as a variance problem when it signals a wrong model form; forgetting that in multiple regression the residual plot against yhat is the one to use.

Self-check: For the pizza model yhat = 60 + 5x and an observation (x=2, y=58), what is the residual, and what does its sign mean on the residual plot?

Connects to: Regression Recap: The Toolkit from the Previous Session, Qualitative Independent Variables: Dummy Variables

Qualitative Independent Variables: Dummy Variables

Must-know: Given a fitted output like yhat = b0 + b1x1 + b2x2 with a dummy, split into the two models (x2=0 and x2=1), note the slope is unchanged, the intercept shifts by b2, and the sign of b2 tells which category has the greater mean; a categorical variable with k levels needs k-1 dummies.

⚠️ Top pitfall: Reading the dummy coefficient b2 as a slope; ignoring that the two categories produce two parallel lines differing only in intercept; forgetting that with k categories you need k-1 dummy variables.

Self-check: For Johnson Filtration with x1 = 4 months, what are the predicted repair times for mechanical and electrical repairs, and why do they differ by about 1.26 hours?

Connects to: Regression Recap: The Toolkit from the Previous Session, Logistic Regression: When the Dependent Variable Is Dichotomous

Logistic Regression: When the Dependent Variable Is Dichotomous

Must-know: Logistic regression is the right tool when the dependent variable is dichotomous (0/1); the equation is p = e^(b0+b1x1+...+bpxp)/(1+e^(b0+b1x1+...+bpxp)); the S-shape keeps predictions in [0,1]; E(y) = P(y=1|x1,...,xp); coefficient reading differs from linear regression.

⚠️ Top pitfall: Applying linear regression to a 0-1 response and reading predictions below 0 or above 1 as meaningful; reading a logistic coefficient as "a one-unit rise in x changes y by b"; forgetting that E(y) equals P(y=1|x).

Self-check: Why can the logistic expression never leave the 0-1 range, and what does E(y) equal for a dichotomous y?

Connects to: Regression Recap: The Toolkit from the Previous Session, Qualitative Independent Variables: Dummy Variables, The Simon's Coupon Example: Fitting Logistic Regression in R

The Simon's Coupon Example: Fitting Logistic Regression in R

Must-know: The estimated logistic equation is written with the fitted coefficients in the exponent: phat = e^(b0 + b1x1 + b2x2)/(1 + e^(b0 + b1x1 + b2x2)); for the coupon data b0 = -2.146, b1 = 0.3416, b2 = 1.0987; substituting x1 = 2, x2 = 0 gives about 0.19 and x1 = 2, x2 = 1 about 0.41; logistic coefficients are not read like linear ones.

⚠️ Top pitfall: Reading b1 and b2 as direct "one-unit change in y" effects; expecting Excel to give a complete logistic output; forgetting family = binomial in the glm call; confusing the coding of y (1 = used coupon, 0 = did not use).

Self-check: For the Simon's data, what estimated probability does the fitted equation give for a customer who spent $2000 and has no credit card?

Connects to: Logistic Regression: When the Dependent Variable Is Dichotomous, Roadmap for the Next Session

A Real Research Application: Consanguinity and Autism Spectrum Disorder

Must-know: Logistic regression applies directly to medical/epidemiological research: a dichotomous health outcome (0/1) is regressed against risk factors such as consanguinity; the 2014 autism study is the lecture's worked instance of this mapping.

⚠️ Top pitfall: Thinking a 0-1 health outcome can be modeled with ordinary linear regression; the outcome must be coded 0/1 and analyzed in probabilities.

Self-check: Why was logistic regression the right tool for the consanguinity-autism study?

Connects to: Logistic Regression: When the Dependent Variable Is Dichotomous

Roadmap for the Next Session

Must-know: Logistic regression coefficients are interpreted through odds and the odds ratio (next session); the course then moves to PCA and LDA, which call for eigenvalues and eigenvectors from linear algebra.

⚠️ Top pitfall: Expecting logistic coefficients to be read directly as linear-regression effects; that is exactly why odds and the odds ratio are introduced.

Self-check: What two techniques follow the odds-ratio discussion, and which one needs eigenvalues and eigenvectors?

Connects to: The Simon's Coupon Example: Fitting Logistic Regression in R

Exam Guidance Summary

Must-know: For a right-tail problem the critical value is positive (about 1.97) and the area to its right is the significance level; exam problems present fitted regression outputs like b0 + 0.340x1 to write and interpret; report adjusted R^2, use F for overall and t for individual significance, check residual plots against Panels A/B/C, and remember the dummy-variable slope/intercept rule.

⚠️ Top pitfall: Placing the Z_alpha critical value on the left side for a right-tail problem; reporting plain R^2 instead of adjusted R^2; missing that a dummy changes only the intercept, not the slope.

Self-check: If the area to the right of Z_alpha is 0.024, where does the critical value sit and what does 0.024 represent?

Connects to: Regression Recap: The Toolkit from the Previous Session, Residual Analysis: Judging a Model by Its Errors, Qualitative Independent Variables: Dummy Variables

Key Industry Applications

Must-know: Logistic regression and dummy variables answer real industry questions: coupon targeting, credit approval, spam detection, medical risk-factor studies; R/SPSS provide direct logistic output while Excel does not.

⚠️ Top pitfall: Using Excel for logistic regression output; forgetting the CSV conversion step before read.csv in R.

Self-check: Which real applications from this lecture are modeled with logistic regression and which with dummy-variable regression?

Connects to: Qualitative Independent Variables: Dummy Variables, Logistic Regression: When the Dependent Variable Is Dichotomous, The Simon's Coupon Example: Fitting Logistic Regression in R, A Real Research Application: Consanguinity and Autism Spectrum Disorder

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.