Quantitative Analysis II — Regression & ML Evaluation
Session at a Glance
Multiple linear regression — interpretation, diagnostics, model building; logistic regression for binary outcomes; BCA: ML evaluation metrics (accuracy, precision, recall, F1, ROC-AUC), cross-validation, benchmarking
Running and interpreting multiple regression; checking regression assumptions; computing ML evaluation metrics; comparing models using cross-validation
2 hrs Lecture + 12 hrs Lab/Project
Complete regression analysis or ML evaluation on capstone data
Learning Objectives
By the end of this session, you will be able to:
- Specify, estimate, and interpret a multiple linear regression model — including unstandardised and standardised coefficients, R² and adjusted R², significance of individual predictors, and the overall model F-test
- Diagnose regression models for violations of assumptions — linearity, normality of residuals, homoscedasticity, independence, multicollinearity, and influential cases — and apply appropriate remedies when assumptions are violated
- Apply and interpret binary logistic regression — including odds ratios, model fit (Hosmer-Lemeshow, pseudo-R²), classification accuracy, and the distinction between statistical significance and predictive utility
- Select and compute appropriate ML evaluation metrics — accuracy, precision, recall, F1-score, ROC-AUC — based on the problem type, class distribution, and the relative cost of false positives vs. false negatives
- Design and implement a rigorous evaluation protocol including k-fold cross-validation, baseline comparisons, and statistical tests for model comparison (e.g., McNemar's test) that supports valid conclusions about model performance
Session Planner
Suggested breakdown of the 4-hour contact session.
| Time | Segment | Activity | Mode |
|---|---|---|---|
| 0:00–0:08 | Opening | Recap Week 13; transition: "Last week: single-variable relationships and group differences. This week: models with multiple predictors, binary outcomes, and systematic evaluation." | Whole class |
| 0:08–0:30 | Lecture 1 | Multiple linear regression — the regression equation, interpreting coefficients (b and β), R² and adjusted R², hierarchical vs. simultaneous entry, the F-test for overall model and t-tests for individual predictors | Lecture |
| 0:30–0:50 | Lecture 2 | Regression diagnostics — linearity, normality of residuals, homoscedasticity, independence (Durbin-Watson), multicollinearity (VIF, tolerance), outliers and influential cases (Cook's distance). Logistic regression — when to use it, odds ratios, model fit, classification tables. | Lecture |
| 0:50–1:05 | Activity | Regression output interpretation: given SPSS/R output tables, extract and correctly interpret coefficients, significance, R², and diagnostics. Identify which assumptions appear violated from diagnostic plots. | Pairs |
| 1:05–1:15 | Discussion | Debrief interpretation exercise; address common errors (confusing b and β, ignoring VIF, overinterpreting R²) | Whole class |
| 1:15–1:30 | Break | — | — |
| 1:30–1:55 | Lecture 3 | ML evaluation — accuracy and its limitations (imbalanced data); precision, recall, F1; the confusion matrix; ROC curves and AUC; k-fold cross-validation; statistical comparison of models (McNemar's test); benchmarking against baselines | Lecture |
| 1:55–2:10 | Activity | Metric selection: given 8 ML scenarios with different class distributions and error costs, select the most appropriate evaluation metric(s) and justify | Pairs |
| 2:10–3:30 | Lab Work | BBA: Run and diagnose multiple regression on capstone/secondary data. BCA: Compute confusion matrix and evaluation metrics; implement cross-validation; compare models. | Individual |
| 3:30–3:50 | Peer Review | Exchange regression diagnostics / ML evaluation outputs; peer checks for correct interpretation and missing diagnostics | Pairs |
| 3:50–4:00 | Exit Ticket | Submit analysis output with interpretation; identify the most concerning diagnostic or the weakest evaluation metric | Individual |
1. Multiple Linear Regression
Multiple regression extends the logic of correlation (Week 13) to models with multiple predictors. While correlation tells you whether two variables are related, regression tells you: (a) how much of the variance in the outcome is collectively explained by the predictors, (b) which predictors uniquely contribute to the model, (c) the direction and magnitude of each predictor's unique effect while controlling for all other predictors, and (d) the predicted value of the outcome for any given combination of predictor values. This conditional, multi-predictor logic is what makes regression the workhorse of quantitative social science and business research.
Y′ = b0 + b1X1 + b2X2 + ... + bkXk. Where Y′ is the predicted value of the outcome; b0 is the intercept (predicted Y when all X = 0); b1 through bk are the unstandardised regression coefficients (the change in Y associated with a one-unit change in X, holding all other X constant); and X1 through Xk are the predictor variables. The standardised coefficients (β, beta weights) express the same relationships in standard deviation units, making the relative importance of predictors measured on different scales comparable.
1.1 Key Output to Interpret
| Output | What It Tells You | How to Interpret | APA Report |
|---|---|---|---|
| R² | The proportion of variance in the DV explained by the model — an overall measure of model fit | R² = .42 means the model explains 42% of variance in the DV. Adjusted R² is preferred — it penalises for adding predictors that don't improve the model, preventing overfitting inflation. | "The model explained 42% of the variance in job satisfaction, R² = .42, adjusted R² = .40, F(4, 182) = 32.94, p < .001." |
| F-test (ANOVA table) | Whether the model as a WHOLE explains significantly more variance than the mean alone (the intercept-only model) | If p < .05, the model with all predictors is a significant improvement over no model. If p > .05, the model does not significantly predict the DV — stop here; individual predictors should not be interpreted. | Report alongside R² as shown above. F(dfregression, dfresidual) = F-value. |
| b (unstandardised coefficient) | The change in the DV (in original units) for a one-unit change in the predictor, holding all other predictors constant | b = 0.34 for "autonomy" (1–5 scale) predicting job satisfaction (1–5 scale): a one-point increase in autonomy is associated with a 0.34-point increase in satisfaction, controlling for other predictors. | "Autonomy was a significant positive predictor, b = 0.34, 95% CI [0.21, 0.47], β = .31, t(182) = 5.23, p < .001." |
| β (standardised coefficient) | The change in the DV (in SD units) for a one-SD change in the predictor. Enables comparison of relative importance across predictors measured on different scales. | β = .31 for autonomy, β = .42 for work-life balance. Work-life balance has a stronger unique effect on job satisfaction than autonomy, even if both are significant. Compare |β| values — but never claim one is "significantly larger" without formal comparison. | Always report both b and β. β is for comparing predictors within a study. b is for comparing across studies or making practical predictions. |
| t-test (per predictor) | Whether each individual predictor contributes significantly to the model, AFTER controlling for all other predictors | p < .05 means the predictor adds significant unique variance beyond what the other predictors already explain. A non-significant predictor may still be correlated with the DV — it just doesn't add UNIQUE variance beyond the other variables in the model. | Report t, df, and p for each predictor as shown above. |
1.2 Hierarchical vs. Simultaneous Entry
| Approach | How It Works | When to Use | Key Output |
|---|---|---|---|
| Simultaneous (Enter) | All predictors are entered into the model at once. Each predictor's contribution is assessed controlling for all others. | When you have no theoretical reason to prioritise certain predictors; when the goal is to identify which variables uniquely predict the DV; the default in most capstone research | One model: R², F-test, and coefficients for all predictors. The simplest approach. |
| Hierarchical (Block Entry) | Predictors are entered in blocks/steps based on theory. Block 1: control variables (demographics). Block 2: main predictors. Block 3: interaction terms. At each step, the R² change (ΔR²) is tested for significance. | When theory specifies a causal or temporal ordering of predictors; when you want to know whether Block 2 variables explain variance BEYOND Block 1 controls; when testing mediation (Blocks → Baron & Kenny approach) | Multiple models: R² at each step, ΔR² and its significance. "Adding the three work characteristics in Step 2 explained an additional 18% of variance, ΔR² = .18, ΔF(3, 179) = 24.61, p < .001." |
(1) Confusing b and β: "Autonomy had a stronger effect than work-life balance because its b was larger." b depends on the measurement scale. Only β is scale-free and comparable. (2) Ignoring non-significant F-test: Interpreting individual predictors when the overall model is non-significant. This is p-hacking by any other name. (3) Causal language: "Autonomy increases job satisfaction" — regression with cross-sectional data supports association, not causation. Use "is associated with" or "predicts" (in the statistical, not causal, sense). (4) R² worship: Treating R² as the sole measure of model quality. A model with high R² but violated assumptions and multicollinearity is worse than a model with modest R² that meets all assumptions. (5) Ignoring the intercept: Reporting coefficients without considering whether the intercept is meaningful. If the intercept represents an impossible value (e.g., predicted satisfaction when age = 0), note this.
2. Regression Diagnostics — Checking Whether Your Model is Valid
Regression makes assumptions, and violating them produces misleading coefficients, incorrect standard errors, and invalid significance tests. Diagnostics are not optional post-hoc checks — they are an integral part of regression analysis. A regression model that has not been diagnostically checked is an untrustworthy model.
2.1 The Six Assumptions and How to Check Them
| Assumption | What It Means | How to Check | Remedy if Violated |
|---|---|---|---|
| 1. Linearity | The relationship between each predictor and the DV is linear. The model cannot capture non-linear relationships (unless transformed). | Scatterplots of each predictor vs. DV; residual vs. fitted plot (should show no systematic pattern — a random cloud is what you want). LOESS curves overlaid on scatterplots. | Transform the predictor (log, square root, polynomial term); add a quadratic term (X²); consider non-linear regression or GAM if relationships are complex. |
| 2. Normality of Residuals | The residuals (errors) are approximately normally distributed. This assumption is about the residuals, NOT the raw variables. | Histogram of residuals; Q-Q plot of residuals; Shapiro-Wilk test on residuals. With n > 100, the CLT makes regression robust to moderate non-normality. | If severe: transform the DV (log, square root, Box-Cox); use robust regression (bootstrapped standard errors); consider a non-parametric alternative. |
| 3. Homoscedasticity | The variance of residuals is constant across all levels of the predicted values. The spread of residuals should not fan out or narrow systematically. | Residual vs. fitted plot: the vertical spread should be roughly constant. Breusch-Pagan test. If the plot shows a funnel shape (wider at one end), heteroscedasticity is present. | Transform the DV; use heteroscedasticity-consistent standard errors (HC3 or HC4; also called "robust standard errors"); weighted least squares regression. |
| 4. Independence of Errors | Residuals are independent of each other. The error for one observation does not predict the error for another. Critical for time-series or grouped data. | Durbin-Watson statistic: values close to 2 indicate no autocorrelation. Values < 1 or > 3 are problematic. Also: think about your design — are observations nested or clustered? | For time-series: use time-series models (ARIMA). For nested data: use multilevel modelling / mixed effects models. Clustered standard errors for grouped data. |
| 5. No Multicollinearity | Predictors are not too highly correlated with each other. High multicollinearity inflates standard errors, making it impossible to separate predictors' unique effects. | VIF (Variance Inflation Factor): VIF < 5 is acceptable. VIF > 10 is a serious problem. VIF > 5 with a non-significant predictor suggests the predictor's contribution is masked by collinearity. Tolerance: 1/VIF; values < 0.2 (VIF > 5) are concerning. | Remove one of the highly correlated predictors (keep the theoretically more important one); combine correlated predictors into a composite or factor score; use ridge regression or PCA regression. |
| 6. No Influential Outliers | No single case or small number of cases disproportionately influences the regression coefficients. One extreme case can pull the regression line substantially. | Cook's Distance: Values > 1 are problematic; values > 4/n warrant investigation. Leverage: values > 2(k+1)/n are high leverage. Standardised residuals: values > |3| are potential outliers. | Investigate influential cases. If data entry errors: fix. If genuine but extreme: run analysis with and without the case(s); report both and discuss sensitivity. Never silently delete cases. |
2.2 Reporting Regression in APA Format
"A multiple regression was conducted to predict [DV] from [list predictors]. The model was significant, F([dfreg], [dfres]) = [F], p = [p], and explained [R²]% of the variance (R² = [value], adjusted R² = [value]). [Predictor 1] was a significant positive predictor, b = [b], 95% CI [lower, upper], β = [β], t([df]) = [t], p = [p]. [Predictor 2] was not a significant predictor, b = [b], β = [β], t([df]) = [t], p = [p]. [Repeat for each predictor.] Diagnostics indicated no serious violations: VIF values were below [max VIF] (acceptable), the Durbin-Watson statistic was [value] (independence met), and the residual plots showed no systematic pattern (see Figure X). One case had Cook's distance of [value]; excluding this case did not substantively change the results, so it was retained."
3. Binary Logistic Regression — When Your Outcome is Yes/No
Linear regression requires a continuous, unbounded DV. When your outcome is binary — purchase (yes/no), churn (yes/no), pass (yes/no) — linear regression produces nonsense (predicted probabilities outside 0–1, heteroscedastic errors, non-normal residuals). Logistic regression solves this by modelling the log-odds (logit) of the outcome as a linear function of the predictors, then transforming back to probabilities using the logistic function. The result: predicted probabilities between 0 and 1, interpretable odds ratios, and valid significance tests.
The logistic model: ln[p/(1−p)] = b0 + b1X1 + ... + bkXk, where p is the probability of the outcome. The key output is the odds ratio (OR = eb): the multiplicative change in the odds of the outcome associated with a one-unit change in the predictor, controlling for other predictors. OR = 1 means no effect. OR > 1 means increased odds. OR < 1 means decreased odds. An OR of 2.5 means: for each one-unit increase in X, the odds of the outcome occurring are multiplied by 2.5 (i.e., 150% higher odds). This is NOT the same as "2.5 times more likely" — odds and probability are different quantities.
3.1 Key Output and Interpretation
| Output | What It Tells You | Interpretation Example |
|---|---|---|
| Omnibus Tests (χ²) | Whether the model with predictors is significantly better than the intercept-only (null) model. Like the F-test in linear regression. | "The model was significant, χ²(4) = 47.32, p < .001, indicating that the predictors collectively distinguish between those who churned and those who did not." |
| Hosmer-Lemeshow Test | A goodness-of-fit test. p > .05 means the model fits the data adequately (the null is that the model fits — you WANT a non-significant result, unlike other tests). | "The Hosmer-Lemeshow test was non-significant, χ²(8) = 6.41, p = .60, indicating acceptable model fit." Note: this test is sensitive to sample size; with large n it may be significant despite decent fit. |
| Nagelkerke R² | A pseudo-R² approximating the proportion of variance explained. Not directly comparable to linear regression R². Typically lower. | "Nagelkerke R² = .34, suggesting the model explains approximately 34% of the variance in churn likelihood." Report as approximate — pseudo-R² values are informative but not precise. |
| Classification Table | Shows what percentage of cases the model correctly classifies, at a default 0.5 probability cutoff. Includes sensitivity and specificity. | "The model correctly classified 78.2% of cases overall, with 82.1% of non-churners and 68.4% of churners correctly identified." Report both sensitivity and specificity — overall accuracy can be misleading with imbalanced classes. |
| Odds Ratio (Exp(B)) | The multiplicative effect on odds. OR = 1.0: no effect. OR = 2.0: odds double per unit increase. OR = 0.5: odds halve per unit increase. | "Satisfaction was a significant predictor (OR = 0.62, 95% CI [0.48, 0.80], p = .001). For each one-point increase in satisfaction, the odds of churning decreased by 38% (i.e., multiplied by 0.62)." Always report 95% CI for OR. |
A common error: interpreting OR = 2.0 as "twice as likely." Odds and probability are different. If the baseline probability of churn is 0.10 (odds = 0.10/0.90 = 0.111), an OR of 2.0 gives odds of 0.222, which corresponds to a probability of 0.182 — not 0.20. The divergence increases as baseline probability increases. If baseline p = 0.50 (odds = 1.0), OR = 2.0 gives p = 0.667. If baseline p = 0.90 (odds = 9.0), OR = 2.0 gives p = 0.947. ORs are most misinterpreted at high baseline probabilities. In your capstone, report ORs but interpret them as changes in odds, not probability. If you need to communicate practical significance, compute predicted probabilities at meaningful values of the predictors and present those instead.
4. Machine Learning Evaluation — Beyond Accuracy
BCA capstones involving classification models require a fundamentally different evaluation framework from the NHST-based approach covered in Weeks 13 and Sections 1–3. ML evaluation is concerned not with parameter inference (is β significantly different from zero?) but with predictive performance (how well does the model perform on unseen data?). Accuracy alone is rarely sufficient and is often misleading.
4.1 The Confusion Matrix — The Foundation of All Classification Metrics
| Predicted | |||
|---|---|---|---|
| Predicted Negative | Predicted Positive | ||
| Actual | Actual Negative | TN (True Negative) | FP (False Positive) Type I Error |
| Actual Positive | FN (False Negative) Type II Error | TP (True Positive) | |
4.2 The Core Metrics — When to Use Each
| Metric | Formula | What It Captures | Best When... | Misleading When... |
|---|---|---|---|---|
| Accuracy | (TP + TN) / Total | Overall proportion correct — the simplest metric | Classes are balanced (roughly equal); the cost of FP ≈ cost of FN | Classes are imbalanced. A model that always predicts "no cancer" has 99% accuracy if cancer rate is 1% but is useless. Never report accuracy alone for imbalanced data. |
| Precision | TP / (TP + FP) | Of all positive predictions, how many were correct? Measures the "cost" of false positives. | False positives are costly. Email spam detection: flagging a genuine email as spam (FP) is worse than missing a spam email (FN). | You care equally about false negatives. Precision ignores false negatives entirely. |
| Recall (Sensitivity) | TP / (TP + FN) | Of all actual positives, how many did the model find? Measures the "cost" of false negatives. | False negatives are costly. Disease screening: missing a disease (FN) is far worse than a false alarm (FP). Fraud detection: missing fraud is worse than a false flag. | You care equally about false positives. A model that predicts "positive" for everything achieves 100% recall but zero precision. |
| F1-Score | 2 × (Precision × Recall) / (Precision + Recall) | The harmonic mean of precision and recall. Balances the two when both matter. | You need a single metric that balances precision and recall; classes are moderately imbalanced; FP and FN have roughly similar costs. | The costs of FP and FN are very different. F1 weights them equally. Use weighted F1 (Fβ) if one error type matters more. |
| ROC-AUC | Area Under the ROC Curve | The model's ability to discriminate between classes across ALL possible thresholds. AUC = 1.0: perfect; 0.5: random; < 0.5: worse than random. | You want a threshold-independent measure of overall discriminative ability; comparing models globally; balanced or moderately imbalanced data. | Extremely imbalanced data (AUC can be optimistic); you need a metric at a specific operating point (AUC averages across all thresholds). Use PR-AUC for highly imbalanced data. |
4.3 Cross-Validation — The Gold Standard for Model Evaluation
A single train/test split tells you how your model performs on ONE random partition of the data. A different split could produce a substantially different result. Cross-validation addresses this by repeating the process across multiple partitions and averaging the results, providing a more reliable estimate of generalisation performance.
| Method | How It Works | Best For |
|---|---|---|
| k-Fold Cross-Validation | Split data into k equal folds. Train on k−1 folds, test on the held-out fold. Repeat k times (each fold serves as test once). Report mean and SD of metric across k folds. | The standard approach. k = 5 or 10 is typical. k = 10 provides a good bias-variance trade-off. Report: "Mean F1 = 0.82 (SD = 0.03) across 10-fold CV." |
| Stratified k-Fold | Like k-fold but preserves class proportions in each fold. Essential for imbalanced data. | Always use stratified CV for classification — it ensures each fold has roughly the same class distribution as the full dataset. |
| Repeated k-Fold | Repeat k-fold CV multiple times with different random splits. Further reduces variance of the performance estimate. | When you need a very stable performance estimate; when comparing models with small performance differences. 5 × 2 or 10 × 10 are common. |
| Leave-One-Out (LOO) | k = n: each observation serves as the test set once. Almost unbiased but very high variance. | Rarely used in capstone research due to computational cost. k = 10-fold is generally preferred for its lower variance. |
4.4 Comparing Models — Beyond "My F1 is Higher"
Comparing model performance requires more than eyeballing mean metrics. A model may outperform another on one data split but underperform on another. Statistical tests for model comparison provide rigour.
| Method | When to Use | What It Tells You |
|---|---|---|
| McNemar's Test | Comparing two classifiers on the SAME test data — examining whether the errors they make differ significantly | "The two models do not make the same errors; Model A correctly classified 23 cases that Model B got wrong, while Model B correctly classified only 8 that A got wrong. McNemar's χ²(1) = 7.26, p = .007 — Model A's advantage is significant." |
| Paired t-test on CV Folds | Comparing two models across k CV folds — testing whether the mean performance difference is significant | Run 10-fold CV for both models on the same folds. For each fold, compute the difference in F1. Paired t-test on the 10 differences. Report: t(9) = 3.41, p = .008, d = 1.08. |
| Baseline Comparison | ALL models should be compared against a meaningful baseline — random classifier, majority-class classifier, or published benchmark | "The proposed model achieved F1 = 0.82, compared with the majority-class baseline F1 = 0.12, the random baseline F1 = 0.48, and the published SOTA result F1 = 0.79 (Joshi, 2023)." Never report model performance in isolation — always with baselines. |
The single most common ML evaluation error: using accuracy for an imbalanced dataset and concluding the model is "92% accurate — excellent." If 92% of emails are not spam, a classifier that always predicts "not spam" achieves 92% accuracy and is completely useless. The metric must be chosen based on: (a) the class distribution, (b) the relative cost of different error types, and (c) what matters to the end user. A medical screening model that misses cancers (low recall) is dangerous even if its precision is perfect. A fraud alert system that generates too many false alarms (low precision) will be ignored by investigators. Articulate in your methodology chapter WHY you chose Precision, Recall, F1, or AUC — not just that you computed them all and reported the highest one.
5. From Analysis Plan to Results Chapter
5.1 BBA Analysis Workflow
Screen data (Week 13 checklist). Handle missing data. Compute scale totals (reverse-code if needed). Check reliability (Cronbach's α ≥ .70). Create dummy variables for categorical predictors.
Report Ms, SDs, and correlation matrix for all variables. This establishes your variables' properties and bivariate relationships before the main analysis.
Run your regression. Report R², F-test, coefficients with CIs, and βs. If hierarchical: report ΔR² at each step.
Check all six assumptions. Report VIF, Durbin-Watson, and key diagnostic plots. Address any violations.
Report in APA format (Section 2.2). Connect results to RQs and hypotheses. Save any supplementary analysis for Week 15 (advanced methods) if needed.
5.2 BCA ML Evaluation Workflow
Specify: dataset(s), train/validation/test split, k-fold CV strategy (k = ?, stratified?), primary metric with justification, secondary metrics, baseline models, statistical test for comparison.
Always establish baselines BEFORE running your model: random classifier, majority-class, simple heuristics, published benchmarks. This frames your model's performance in context.
Run k-fold CV. For each fold: train, predict, compute metrics. Report mean and SD across folds. Present the confusion matrix for the best-performing fold or the aggregated results.
Compare your model against baselines and (if applicable) between variants of your model. Use McNemar's test or paired t-test on CV fold metrics.
Beyond aggregate metrics: analyse WHERE and WHY your model fails. Examine false positives and false negatives. Are errors concentrated in specific subclasses, rare cases, or ambiguous instances? Error analysis often provides more insight than aggregate metrics alone.
Think Deeper — Cross Questions
Discuss in pairs before sharing with the class.
A student reports: "Multiple regression revealed that training hours (β = .28, p = .002), autonomy (β = .31, p < .001), and supervisor support (β = .18, p = .045) significantly predicted job performance. Therefore, autonomy is the most important predictor." Critique the conclusion that autonomy is "most important." What additional analysis would be needed to justify a claim about relative importance? How would you report these findings without overclaiming?
Your logistic regression model achieves 84.5% classification accuracy on customer churn data where 22% of customers churned. The confusion matrix shows: TN = 142, FP = 8, FN = 23, TP = 27. Your colleague says: "84.5% accuracy is strong — deploy it." Analyse the confusion matrix. What is the recall for churners? What is the precision of churn predictions? If the cost of losing a customer (FN) is 5× the cost of offering a retention discount to a non-churner (FP), is this model fit for purpose?
A BCA student trains a hate speech classifier and reports: "Accuracy = 94.2%, F1 = 0.93." The dataset has 6% hate speech and 94% non-hate speech. The student does not report precision, recall, or a confusion matrix. What is the most generous possible interpretation of these numbers? What is the most concerning possible interpretation? What is the minimum set of metrics and analyses that should be reported for this problem?
You run a regression with VIF values of 6.8 (autonomy), 7.2 (empowerment), and 2.1 (tenure). Autonomy and empowerment are correlated at r = .84. Both are significant in the regression, but their standard errors are large. Your supervisor suggests dropping empowerment. Your second supervisor suggests keeping both because "both are significant." Who is right? What is the real consequence of multicollinearity here — and what is the best course of action?
Quick Check — Metric Selection
Select the most appropriate primary evaluation metric for each scenario.
1. A fraud detection system where 0.5% of transactions are fraudulent. Missing a fraudulent transaction (FN) costs the bank ₹50,000 on average. Investigating a false alarm (FP) costs ₹200. You need to maximise the detection of fraud while keeping investigation costs manageable.
2. An email spam classifier where flagging a genuine email as spam (FP) is extremely costly — users may miss important messages. Missing some spam (FN) is an inconvenience but not catastrophic.
3. You run a regression predicting salary from years of experience, education level, and gender. The VIF for "years of experience" and "age" is 9.4 (both included in the model). Both are significant. What should you do?
4. You need to compare two models across the same 10-fold CV splits. Model A: mean F1 = 0.85 (SD = 0.03). Model B: mean F1 = 0.83 (SD = 0.04). How do you determine whether Model A is genuinely better?
Knowledge Check — Interactive Quiz
Test your understanding of regression and ML evaluation.
Q1. In multiple regression, what does the standardised coefficient (β) represent?
Q2. A VIF of 8.5 for a predictor in your regression model indicates:
Q3. In a dataset where 95% of emails are legitimate and 5% are spam, a classifier that always predicts "legitimate" achieves what accuracy?
Q4. An odds ratio (OR) of 0.40 for a predictor in a logistic regression means:
Q5. Which of the following statements about k-fold cross-validation is correct?
Lab Activity — Regression and ML Evaluation in Practice
Part A: Run and Diagnose a Multiple Regression (60 min)
- Using your capstone data or the provided practice dataset, run a multiple regression with 3–6 predictors.
- Complete the regression report table below.
- Run all six diagnostics. For each: state the test/plot, the result, and whether the assumption is met.
| Element | Your Result |
|---|---|
| R² / Adjusted R² | |
| F-test (F, df, p) | |
| Predictor 1: b, β, t, p, VIF | |
| Predictor 2: b, β, t, p, VIF | |
| Predictor 3: b, β, t, p, VIF | |
| Durbin-Watson | |
| Highest Cook's Distance | |
| Key violation(s) or "all assumptions met" |
Part B: Compute ML Evaluation Metrics (45 min)
- Using your model's predictions or the provided sample output, construct the confusion matrix.
- Compute: accuracy, precision, recall, F1, and (if applicable) ROC-AUC.
- Identify the most appropriate PRIMARY metric for your problem. Justify with reference to class distribution and error costs.
- Report your model's performance against at least two baselines.
Part C: Cross-Validation and Model Comparison (45 min)
- Implement stratified k-fold CV (k = 5 or 10) for your model.
- Report mean and SD of your primary metric across folds.
- If comparing models: run CV for all models on the same folds. Compute the per-fold difference. Run a paired t-test or report the number of folds where Model A outperforms Model B.
Exit Ticket
Submit with your analysis output.
- Submit your regression or ML evaluation results. What is the single most important finding?
- If running regression: Did any diagnostic indicate a potential violation? How did you address it? If running ML evaluation: What is your primary metric, and why is it the most appropriate for your problem?
- What is the largest gap between the analysis you planned in your methodology chapter and the analysis you were actually able to run this week?
- Looking at your results: What surprised you? What finding do you want to explore further in Week 15?
- One question about regression or ML evaluation you need answered before finalising your results chapter:
Key Takeaways — Week 14
Multiple regression quantifies how predictors collectively and uniquely relate to an outcome. It does not establish causation. Use associational language. Report both b (practical interpretation) and β (relative importance). Always diagnose your model — unreported assumption violations produce untrustworthy results.
Accuracy is misleading for imbalanced data, which describes most real-world classification problems. Your primary metric must match your problem's error costs. Report precision, recall, F1, and the confusion matrix — not accuracy alone. Always benchmark against meaningful baselines.
A single train/test split gives an unstable performance estimate. k-fold cross-validation (stratified) provides a more reliable estimate with quantifiable variance. Use statistical tests (McNemar's, paired t-test) to compare models — not eyeballing mean differences.
Regression diagnostics are not optional checks to be buried in an appendix. They are part of your results — the reader must know whether your model's assumptions are met to evaluate the trustworthiness of your findings. Report them in the results chapter.
Facilitator Notes
Preparation Checklist
- Prepare practice datasets: one with clean regression data (all assumptions met, clear predictors), one with deliberate problems (multicollinearity, heteroscedasticity, an influential outlier), and one imbalanced classification dataset for ML evaluation practice.
- Prepare annotated SPSS/R/Python output showing a complete regression with diagnostics — annotated to show exactly what to look for in each output table. Students struggle to navigate the volume of output these tools generate.
- For the ML evaluation segment: prepare a confusion matrix worksheet — given raw predictions and actual labels, students compute all metrics by hand before using code. Understanding the formulas builds intuition that calling sklearn.metrics.classification_report does not.
- Have exemplar results chapters (one BBA regression-based, one BCA ML evaluation-based) available. Students need to see what a well-written results chapter looks like — tables formatted in APA, diagnostics reported, findings connected to RQs.
Common Student Difficulties
- Confusing significant with important in regression: With n = 500, even tiny β values become significant. Students must report β and assess practical significance — not just scan the p-value column for asterisks.
- Reporting accuracy for imbalanced classification: BCA students routinely report 95% accuracy on data with 5% positive class. This must be caught and corrected — ask "What would a majority-class classifier achieve?" in every supervision meeting.
- Ignoring the Durbin-Watson test: Students check normality (because it's visual) and ignore independence (because it's just a number). Independence is the most critical assumption for time-series or grouped data — emphasise this.
- No baseline comparison in ML evaluation: Students report their model's F1 = 0.78 in isolation. Always ask: "Compared to what? What would a random model achieve? What does the published benchmark achieve?"
Pacing Tips
- This week bridges BBA and BCA analysis traditions. The regression content (Sections 1–3) is primarily for BBA and quantitative BCA students; the ML evaluation content (Section 4) is for BCA students. Structure the lab accordingly — have both tracks running simultaneously with TAs supporting each.
- Some BBA students will need logistic regression (binary outcomes like churn, purchase, turnover). Ensure the logistic regression content (Section 3) is covered even if you need to shorten the ML evaluation lecture — BBA students doing binary outcome research need logistic regression more than they need ROC-AUC.
- The peer review segment is important — students misinterpret their own regression output systematically (confusing b and β, ignoring VIF, overinterpreting R²). A second pair of eyes catches these errors.
- Week 15 (Advanced Methods) can cover mediation, moderation, factor analysis, and non-parametric alternatives for students who need them. Flag students this week whose RQs require methods beyond what Weeks 13–14 cover.