Generalised Linear Models - I
Saket Choudhary
Biostatistics in Healthcare
DH 801
Lecture 12 || Tuesday, 4th November 2025
Penalised Regression Cont.
dfdf
Dimensional reduction methods
dfdf
The Goal - 1D PCA
dfdf
The Goal - 1D PCA
Goal: Reduce the dimensionality of data by projecting the data into lower dimensional space such that the reconstruction error is minimized
dfdf
Minimizing reconstruction error = Maximizing variance
Original point
Projected
point
Reconstruction error
Variance
How can we determine the direction of maximal variance?
dfdf
PCs are linear combination of existing features
PC1 = φ11X + φ12Y
PC2 = φ21X + φ22Y
Principal Component Analysis - Variance explained
Function | loadings | scores | plot |
prcomp(P, center=TRUE, scale=TRUE) | X$rotation | X$x | biplot(res) |
Two equivalent interpretation:
dfdf
PCA: the optimization
dfdf
Principal Components Regression
dfdf
PCR: Bias variance tradeoff for determining components
Elastic Net
Linear regression
Under constraints on beta
Elastic Net
GLMs
Revisiting OLS
Problem
Survey data:
Problem
Problem
Problem
OLS
ls_model <- lm(visits ~ health + chronic_condition + gender + age_years + private_insurance + illness,
data = health_data)
dfdf
Linear regression: Assumptions
dfdf
What does the linear regression really model?
Independent variables (x) are measured without error, but there is error in the measurement of dependent variables (y)
Generalized linear models
Value of explanatory variable j for observation i
Components of a GLM
Advantage of GLM rather than transforming
Link function
Ughhhh, this is so confusing…
g(Y)
Distribution of e
Back to the problem
Visualising GLM predictions
dfdf
Questions