MAST90139 Statistical Modelling for Data Science
MAST90139 Overview
- University of Melbourne
- S1 2026
- 8 chapters
- Science
Statistical Modelling for Data Science teaches one engine — the generalised linear model (GLM) — and then watches it bend to every response type: binary, grouped-binomial, count, contingency-table and multicategory (nominal and ordinal) data, all fitted in R.
- Assessed by Assignment 1 — logistic regression Weight: confirm · Assignment 2 — binomial dose-response Weight: confirm + 2 more
- Key terms Generalised linear model (GLM), Link function, Deviance, Odds ratio
- How to prepare Build everything on Chapter 2, the GLM framework — random component, linear predictor and link &mdash…
- Most asked What is on the MAST90139 final exam?
How MAST90139 is assessed
| Component | Weight | Format |
|---|---|---|
| Assignment 1 — logistic regression | Weight: confirm | Binary / grouped logistic, odds-ratio interpretation · submitted to Gradescope (due ~early April) |
| Assignment 2 — binomial dose-response | Weight: confirm | Beetle-mortality dose-response, link comparison · Gradescope (due ~early May) |
| Assignment 3 — ordinal / multinomial | Weight: confirm | 3-category ordinal response with polr · Gradescope (due ~end May) |
| Final examination | Weight: confirm | Read-the-R-output across the whole GLM arc — weight, length and book-status are not in the supplied source; confirm the exact split and format in your subject guide |
What MAST90139 covers
Eight model families → one exam-ready map. Each links to its free chapter guide — and they are all the same generalised linear model.
Linear Models
Matrix form · OLS = MLE · LINE assumptions · the GLM springboardThe normal linear model is where every generalised linear model starts — and the case they all generalise.
- 1.1 The normal linear model in matrix form (y = Xβ + ε)
- The design matrix, fitted values and residuals
- 1.2 OLS estimation — and why OLS = MLE under normality
- Sampling distribution of β̂ · the t and F tests
- 1.3 The four LINE assumptions
- Residual diagnostics — and where LINE breaks
Generalised Linear Models
The three components · exponential family · link functions · IRLS · devianceThis is the spine of the whole course.
- The three components: random, systematic, link
- The exponential family of distributions
- Canonical vs non-canonical link functions
- The mean–variance relationship Var(Y) = φV(μ)
- Estimation by iteratively re-weighted least squares (IRLS)
- Deviance and the saturated model
Logistic Regression
Logit link · odds ratios e^β · Wald vs LR tests · ROC & AUCLogistic regression is the flagship GLM of MAST90139 and the single most examined model.
- The binary response and why a line fails
- The logit link and the logistic (S-shaped) curve
- Coefficients as log-odds; e<sup>β</sup> as an odds ratio (★ the #1 skill)
- Wald tests and likelihood-ratio tests
- Confidence intervals for β and for the odds ratio
- Classification: threshold, confusion matrix, sensitivity / specificity
Binomial Models
Grouped logistic · deviance goodness-of-fit · overdispersion · dose-response & LD50When binary outcomes are grouped — r successes out of n trials at each covariate setting — the response is binomial and you fit grouped logistic regression.
- Grouped (binomial) logistic regression: r successes out of n
- Residual deviance and Pearson X² as goodness-of-fit statistics
- The χ² goodness-of-fit test on n−q df
- Dose–response models and LD50
- Overdispersion: detecting D ≫ df
- Estimating the dispersion φ and refitting quasi-binomial
Poisson Regression
Log link · rate ratios · offsets for rates · overdispersion & deviance GoFWhen the response is a count — emails per hour, claims per policy, cases per region — the linear model breaks: counts are non-negative integers whose variance grows with their mean.
- The Poisson distribution: mean = variance
- The Poisson regression model and the log link
- Reading e<sup>β</sup> as a rate ratio (★ the examined skill)
- Offsets: modelling rates instead of counts (★)
- Deviance and Pearson X² goodness-of-fit
- Comparing nested models by ΔD vs χ²
Log-Linear Models
Contingency tables as Poisson counts · independence vs saturated · cross-product ratioLog-linear models analyse a contingency table by treating each cell count as a Poisson response with a log link — so this is Poisson regression where the predictors are the table's classifying factors.
- Contingency-table cells as Poisson counts
- Independence ⇔ no interaction term (the central identity)
- The saturated model and the hierarchy of terms
- The cross-product (odds) ratio for a 2×2 table (★)
- Interaction = association; uniform association
- Log-linear ≡ logistic for a two-way table
Multicategory Models
Baseline-category logit (nominal) · proportional odds (ordinal) · cumulative ORsWhen the response has more than two categories, you extend logistic regression in one of two ways depending on whether the categories are ordered.
- The multinomial response: more than two categories
- Nominal: the baseline-category logit (multinom)
- Ordinal: the cumulative-logit / proportional-odds model (polr)
- The proportional-odds assumption and the single slope
- Cumulative odds ratios
- The polr() sign-convention trap (★ the known trap)
Model Checking
ΔD / likelihood-ratio test · AIC & BIC · residual diagnostics · leverage & influenceThe final chapter answers two questions about any fitted GLM: did it fit? and is it the right model? Fit is judged by the deviance and the likelihood-ratio test: for nested models the drop in deviance ΔD = D₀ − D₁ is χ² on the difference in parameters, and for grouped data the residual deviance itself is a goodness-of-fit test.
- Deviance and the likelihood-ratio test for nested models
- Residual deviance as a goodness-of-fit test (grouped data)
- AIC and BIC for ranking non-nested rivals
- Deviance vs Pearson residuals — reading a good fit
- Leverage and influence: hat values, half-normal plots, Cook's distance
- Extension: random and mixed effects (GLMMs)
The exam is a read-the-R-output gauntlet: given a glm() / multinom() / polr() printout you must name the model and link, do the deviance / ΔD-vs-χ² arithmetic by hand, and translate a coefficient into an odds / rate / cumulative-odds statement.
This guide teaches each family to that standard, so you can read any printout and say exactly what it means.
Worked example · free
Reading a glm() printout — logistic coefficient to odds ratio, mark by mark
- +2(a) Slope → odds ratio: in logistic regression the coefficient is on the log-odds scale, so eβ is the odds ratio: e0.80 ≈ 2.23. Each one-unit rise in x multiplies the odds of the event by about 2.2.
- +1(b) Linear predictor at x = 2.5: η = −2.0 + 0.80×2.5 = 0.
- +1(b) Inverse-logit: π = 1 / (1 + e−η) = 1 / (1 + e0) = 0.5 — the curve crosses 0.5 exactly where η = 0.
- +1(c) Likelihood-ratio test: ΔD = Dnull − Dresid = 180 − 150 = 30, on 99 − 98 = 1 df.
- +1(c) Compare to χ²: 30 ≫ χ²1, 0.05 = 3.84, so reject H₀ — x is a highly significant predictor.
Key terms
- Generalised linear model (GLM)
- A model with three parts: a random component (a response from an exponential-family distribution), a linear predictor η = Xβ, and a link function g that connects them, g(μ) = η. Linear, logistic, Poisson and log-linear regression are all special cases.
- Link function
- The function g that maps the mean μ onto the linear-predictor scale, g(μ) = η = Xβ. The logit link gives logistic regression (binary data), the log link gives Poisson regression (counts); each “canonical” link pairs with a distribution.
- Deviance
- The GLM analogue of the residual sum of squares: twice the log-likelihood gap between the saturated model and your fitted model. Smaller deviance means better fit; the drop in deviance between nested models is the likelihood-ratio test statistic.
- Odds ratio
- e raised to a logistic coefficient, eβ — the factor by which the odds of the event multiply for a one-unit rise in the predictor. Greater than 1 raises the odds, less than 1 lowers them; it is the headline output of any logistic fit.
- Overdispersion
- When count or grouped-binomial data vary more than the Poisson or binomial model allows (residual deviance far exceeds its degrees of freedom). It is fixed by estimating a dispersion parameter φ and refitting a quasi-likelihood model, then testing with an F test rather than χ².
MAST90139 FAQ
Is MAST90139 hard?
It is procedural once the GLM framework clicks, but it is dense. The trick is realising that logistic, Poisson, log-linear and ordinal regression are the same three-part model with a different distribution and link — learn that engine cold and the rest is pattern-matching. The difficulty is reading R output fast and interpreting coefficients correctly under exam time.
How is MAST90139 assessed?
The supplied source confirms three written assignments submitted to Gradescope (logistic, binomial dose-response, and an ordinal/multinomial study) plus a final examination. The exact weights, exam length and whether the exam is open- or closed-book are not stated in the supplied material — confirm them in the official subject guide / Handbook, as they shift between cohorts.
What is on the MAST90139 final exam?
A read-the-R-output gauntlet across the whole GLM arc: given a glm(), multinom() or polr() printout, name the model and link, do the deviance / ΔD-vs-χ² arithmetic by hand, and translate a coefficient into an odds ratio (logit), a rate ratio (log) or a cumulative odds ratio (proportional odds).
What maths and software do I need for MAST90139?
You need matrix algebra, likelihood and the normal/exponential-family distributions, plus comfort reading regression output.
All fitting is done in R (the faraway package, with glm, polr and multinom); you are not asked to invert matrices by hand, but you are asked to read and interpret what R prints.
Is using AskSia for MAST90139 cheating?
No. AskSia is a study reference written in our own words — we host none of your lecturer's files, and Sia teaches you the method to read a printout and earn the marks; it does not complete or sit your assessments.
Questions students ask in each MAST90139 chapter
- Why does MAST90139 start with the linear model if the course is about GLMs?
- Because every GLM is the linear model with two changes: a non-normal random component and a link function on the mean. Reviewing the linear model fixes the matrix vocabulary (design matrix, hat matrix, residuals) and the LINE assumptions, so that when those assumptions fail for binary or count data you can see exactly which piece the GLM replaces and why. Chapter 01 · Linear Models
- What exactly makes something a GLM?
- Three ingredients: a response from an exponential-family distribution (the random component), a linear predictor η = Xβ (the systematic component), and a link function g with g(μ) = η. Fix the distribution and the link and you have named a specific model. Almost every model in MAST90139 is one choice of those two ingredients. Chapter 02 · Generalised Linear Models
- Why can't I just fit a straight line to a 0/1 response?
- Two reasons. Fitted values from a line run below 0 and above 1, which are impossible probabilities; and the variance of a 0/1 (Bernoulli) response is π(1−π), which changes with the mean rather than staying constant. Logistic regression fixes both by modelling the log-odds linearly, so fitted probabilities stay in (0,1) and the right variance is built in. Chapter 03 · Logistic Regression
- What is the difference between binomial and ordinary logistic regression?
- They are the same model with the data organised differently. Ungrouped logistic regression has one 0/1 row per individual; binomial (grouped) logistic regression collapses individuals with identical covariates into r successes out of n trials. The coefficients and odds ratios are the same, but grouping makes the residual deviance a valid goodness-of-fit test. Chapter 04 · Binomial Models
- Why use Poisson regression instead of a linear model on the counts?
- Three failures of the linear model on counts: the fitted mean can go negative (impossible for a count); the variance is not constant but equals the mean, so large counts are noisier; and the integer, right-skewed shape is far from normal. The Poisson GLM fixes all three at once by modelling log(μ) linearly and letting Var = μ. Chapter 05 · Poisson Regression
- How is a log-linear model just Poisson regression?
- Because each cell count in the contingency table is modelled as a Poisson response with a log link, and the predictors are the table's classifying factors and their interactions. Everything from Poisson regression — the log link, the deviance, goodness-of-fit — carries straight over; the only new idea is reading factor interactions as associations. Chapter 06 · Log-Linear Models
- When do I use multinom() versus polr()?
- It depends entirely on whether the response categories are ordered. Unordered (nominal) responses — brand, transport mode, holiday type — use the baseline-category logit via nnet::multinom(). Ordered (ordinal) responses — severity, satisfaction, ratings — use the proportional-odds (cumulative-logit) model via MASS::polr(), which exploits the ordering with a single slope. Chapter 07 · Multicategory Models
- How do I test whether adding terms improves a GLM?
- If the smaller model is nested in the larger, use the likelihood-ratio test: compute ΔD = Dsmall − Dlarge and compare it to χ² on the difference in the number of parameters. A significant drop means the extra terms matter. In R this is anova(m0, m1, test="Chi"). Chapter 08 · Model Checking
How to study for the exam
Build everything on Chapter 2, the GLM framework — random component, linear predictor and link — because every later model is that template with a new distribution and link.
Then drill the three recurring exam moves until they are automatic: Name (response type → distribution → canonical link), Test (ΔD = D₀ − D₁ against χ² with the df difference for nested models; D against χ²(n−q) for grouped goodness-of-fit), and Interpret (eβ as an odds ratio, rate ratio, cross-product ratio or cumulative OR).
Practise on real R printouts so you can do the deviance arithmetic and the coefficient sentence at speed — that triple is the whole paper.