slides EN
Table of contents
- Applications of Statistics (D0O70A)
- Linear regression
- Estimation
- Finite sample properties
- Large sample or asymptotic properties
- Goodness–of–fit
- Hypothesis testing
- Prediction
- Violations of assumptions
- Error terms are non-normal
- Limited dependent variables
- Limited dependent
- Logistic regression
- X i = 0.
- Probit regression
- General properties
- Goodness–of–fit
- Hypothesis testing
- Prediction
- The generalized linear model
- Causal inference
- Randomized controlled trials
- Measured confounding
- Assumptions
- Regression estimators
- Matching estimators
- Propensity score estimators
- The JTPA data set
- Unmeasured confounding
- Instrumental variables
- Effect homogeneity
- Monotonicity
- Alternative approaches
1. Applications of Statistics (D0O70A)
1.1 Instructor and communication
The course "Applications of Statistics" (D0O70A) for the 2026-2027 academic year is taught by Prof. Dr. Ingrid Van Keilegom. Communication regarding practical or administrative issues should be directed via email, while questions about course material are handled through the discussion board on Toledo 4.
- Instructor: Prof. Dr. Ingrid Van Keilegom (ingrid.vankeilegom@kuleuven.be).
- Teaching format: All lectures are conducted on campus, with recordings provided for student access.
- Course materials: Slides are made available on Toledo and are updated weekly.
1.2 Prerequisites
To succeed in this course, students must possess foundational knowledge in several key areas, which are essential for understanding the advanced statistical models and methods covered 5.
- Mathematics: Familiarity with functions, mathematical notation, vectors, matrices, linear systems, inverses, eigenvalues, and eigenvectors.
- Probability & statistics: Understanding of conditional probability, Bayes’ rule, random variables and distributions, sampling, expectation, confidence intervals, hypothesis testing, p-values, and the central limit theorem.
- Regression: Basic knowledge of linear regression.
- R: Proficiency in basic data manipulation and statistical analysis using R.
- Revision resources: Available on Toledo for students to review prerequisite topics.
1.3 Learning objectives
Upon completion of this course, students are expected to demonstrate a comprehensive understanding and practical application of statistical methodologies 6.
- Model comprehension: Understand the statistical models and methods presented in the course.
- Method recognition: Identify when and why specific statistical methods are appropriate and useful.
- Method selection: Choose the most suitable method for a given research question and dataset.
- Application: Correctly apply the learned methods using R software.
- Interpretation and communication: Clearly and accurately interpret and communicate the results of statistical analyses.
1.4 Course content
The course covers a range of advanced statistical topics, building upon foundational knowledge to address complex data analysis challenges 7.
| Chapter | Topics Covered |
|---|---|
| 0. Review Linear Regression | Review of fundamental linear regression concepts |
| 1. Limited Dependent Variables | Logistic regression, Survival analysis |
| 2. Causal Inference | Measured and unmeasured confounding, Panel data |
| 3. Multivariate Statistics | Principal component analysis, Exploratory factor analysis, Cluster analysis |
| 4. Statistical Learning | Introduction to statistical learning, Model assessment and selection, Decision trees, Neural networks |
📝 Chapter 1, "Limited Dependent Variables," covers Logistic regression and Survival analysis 7.
1.5 Exercises
Exercises are provided on Toledo to reinforce learning and prepare for the exam. These exercises are an integral part of the course material 8.
- Availability: Exercises for each chapter are released after the chapter's completion.
- Solutions: Solutions are provided, but exercises are not discussed during class sessions.
- Purpose:
- Check understanding of theoretical concepts.
- Practice applying statistical methods.
- Prepare for the final examination.
1.6 Exam information
The final exam is a 3-hour assessment conducted in a computer room, designed to evaluate both theoretical understanding and practical application skills 9.
- Duration: 3 hours.
- Environment: Computer room, with R software available.
- Question types:
- Multiple-choice questions, with a correction for guessing.
- Open questions requiring detailed responses.
- Assessment areas:
- Understanding of statistical theory.
- Ability to select appropriate statistical methods.
- Application of methods to data using R.
- Interpretation of statistical results and R output.
- Resources: Closed book, except for a provided cheat sheet containing selected R functions and formulas.
📝 The exam is 3 hours long and takes place in a computer room, where R software is available for application questions 9.
2. Linear regression
2.1 Simple linear regression model
Linear regression aims to model the relationship between a dependent variable (Yi) and an independent variable (Xi) for a sample of n observations, approximating this relationship with a straight line. The model includes a random error term (ϵi) to account for unexplained variation 11.
- Model specification: The simple linear regression model is expressed as Yi=β1+β2Xi+ϵi.
- Variables:
- Yi: Dependent variable.
- Xi: Independent variable.
- β1: Intercept, representing the expected value of Yi when Xi is zero.
- β2: Slope, indicating the change in Yi for a one-unit change in Xi.
- ϵi: Random error term, capturing unobserved factors and random noise 11.
📝 In a housing market analysis, the house price (Yi) can be modeled as a function of the distance to the nearest train station (Xi). The model would predict how house prices change as the distance to the train station varies 11.
2.2 Dataset for housing price analysis
The housepricedata.csv dataset, collected from Taiwan's Ministry of the Interior between June 2012 and May 2013, contains 378 observations used to illustrate linear regression concepts 12.
- Dependent variable:
- unit_price: Residential housing price per unit area, measured in 10,000 New Taiwan Dollar per Ping (where 1 Ping = 3.3 m2).
- Independent variables:
- distance_to_train: Distance to the nearest train station (standardized, mean = 1066.73 m, standard deviation = 1262.38 m).
- house_age: House age at transaction (standardized, mean = 17.28 years, standard deviation = 11.13 years).
- stores: Number of convenience stores within 500 m (categorized as 0, 1–5, or 6–10 stores) 12.

2.3 Modeling design
The data for linear regression consists of n independent observations, where Yi is the dependent variable and Xi=(Xi1,…,Xip)⊤ is a p-dimensional vector of independent variables. For consistency, Xi1 is typically set to 1 for all observations 15.
| Design Type | Description |
|---|---|
| Fixed design | Regressors (Xi) are fixed in repeated samples, and the outcome (Yi) is sampled conditionally on Xi (e.g., an experiment). |
| Random design | (Xi, Yi) are independent and identically distributed (i.i.d.) draws from a population (e.g., an observational study). |
- Common practice: The random design is more prevalent in economics and will be the focus of subsequent discussions 15.
2.4 Multiple linear regression model
The multiple linear regression model extends the simple linear regression by incorporating multiple independent variables to explain the variation in the dependent variable 16.
- Individual observation equation: Yi=β1+β2Xi2+⋯+βpXip+ϵi.
- β=(β1,…,βp)⊤: Vector of unknown population parameters.
- ϵi: Unobserved error term.
- Linearity: The model is linear in its unknown parameters (βj).
- Matrix notation: The model can be compactly expressed as Y=Xβ+ϵ.
- Y=(Y1,…,Yn)⊤: Vector of dependent variable observations.
- X=(X1,…,Xn)⊤: Design matrix containing all independent variable observations, where each Xi is a row vector (1,Xi2,…,Xip).
- ϵ=(ϵ1,…,ϵn)⊤: Vector of error terms 16.

📝 To predict
unit_price, a multiple linear regression model could includedistance_to_train,house_age, andstoresas independent variables. Thestoresvariable, being categorical, would be treated as a factor in the model 17.

3. Estimation
3.1 Ordinary least squares (OLS) estimator
The ordinary least squares (OLS) estimator is a method used to estimate the unknown parameters in a linear regression model by minimizing the sum of the squares of the residuals, which is the difference between the observed and predicted values 19.
- Definition: The OLS estimator β^OLS is defined as the argument that minimizes the squared Euclidean norm of the difference between the observed vector Y and the predicted vector Xβ.
- Formula: β^OLS=argminβ∥Y−Xβ∥2.
- Normal equations: Differentiating the minimization problem with respect to each β and setting the derivatives to zero yields the normal equations: XT(Y−Xβ)=0.
- Solution: Given that the design matrix X has full column rank (i.e., rank(X)=p), the unique solution for the OLS estimator is β^OLS=(XTX)−1XTY 19.

3.2 Simple linear regression OLS estimators 20
For a simple linear regression model, which involves one independent variable, the OLS estimators for the intercept and slope can be expressed in terms of sample means and sums of squares 20.
- Model: The simple linear regression model is given by Yi=β1+β2Xi+ϵi, where β1 is the intercept and β2 is the slope.
- Sample means:
- Yˉ=n−1∑i=1nYi
- Xˉ=n−1∑i=1nXi 20.
| Coefficient | OLS Estimator Formula |
|---|---|
| Slope β^2,OLS | ∑i=1n(Xi−Xˉ)2∑i=1n(Xi−Xˉ)(Yi−Yˉ) |
| Intercept β^1,OLS | Yˉ−β^2,OLSXˉ |

4. Finite sample properties
4.1 Gauss-Markov conditions
The Gauss-Markov (GM) conditions are a set of assumptions under which the Ordinary Least Squares (OLS) estimator possesses desirable finite sample properties, specifically being the Best Linear Unbiased Estimator (BLUE) 22.
- Condition A1 (Exogeneity): The expected value of the error term, ϵi, conditional on the regressors, X, is zero for all observations. This implies that E[Yi∣X]=Xi⊤β, meaning the regressors are uncorrelated with the error term.
- Condition A2 (Homoscedasticity): The variance of the error term, ϵi, conditional on X, is constant across all observations and equal to σ2. This ensures that the errors have a uniform variance.
- Condition A3 (No Autocorrelation): The covariance between any two distinct error terms, ϵi and ϵj, conditional on X, is zero. This means errors are uncorrelated with each other, leading to "spherical errors" where Var(ϵ∣X)=σ2In.
- Condition A4 (Full Column Rank): The matrix X has full column rank, implying that there is no perfect multicollinearity among the regressors. This ensures that (X⊤X)−1 exists 22.
4.2 Gauss-Markov theorem
The Gauss-Markov theorem states that under the Gauss-Markov assumptions (A1-A4), the OLS estimator is the Best Linear Unbiased Estimator (BLUE) of β 22.
| Property | Explanation |
|---|---|
| Linear | The OLS estimator β^OLS=(X⊤X)−1X⊤Y is a linear function of the dependent variable Y. |
| Unbiased | The expected value of the OLS estimator, E[β^OLS∣X], is equal to the true parameter β. |
| Best (Efficient) | Among all linear unbiased estimators, OLS has the minimum variance for any linear combination of the coefficients. This means Var(v⊤β^∣X)≥Var(v⊤β^OLS∣X) for any vector v and any other linear unbiased estimator β^. |
📝 If one were to compare the OLS estimator with another linear unbiased estimator, such as a weighted least squares estimator under specific conditions, the Gauss-Markov theorem guarantees that the OLS estimator will have a smaller or equal variance for any linear combination of the estimated coefficients, making it more precise 23.
4.3 Estimation of residual variance
Under the GM conditions, the variance of the OLS estimator is given by Var(β^OLS∣X)=σ2(X⊤X)−1. However, the true error variance, σ2, is typically unknown and must be estimated 24.
- Estimated residual variance: The unbiased estimator for the residual variance, σ^OLS2, is calculated as n−p1∑i=1nϵ^i2, where ϵ^i=Yi−Xi⊤β^OLS are the OLS residuals and p is the number of regressors (including the intercept).
- Estimated variance of OLS estimator: By substituting σ^OLS2 for σ2, an unbiased estimator for Var(β^OLS∣X) is obtained: Var^(β^OLS∣X)=σ^OLS2(X⊤X)−1 24.
5. Large sample or asymptotic properties
5.1 Consistency and asymptotic normality of OLS estimators
Under Gaussian Markov (GM) conditions and appropriate regularity conditions, Ordinary Least Squares (OLS) estimators exhibit desirable large sample properties, specifically consistency and asymptotic normality 26.
| Property | Description | Underlying Theorem |
|---|---|---|
| Consistency | As the sample size (n) approaches infinity, the estimator converges in probability to the true parameter value. | Law of Large Numbers |
| Asymptotic Normality | Even if the data are not normally distributed, the OLS estimator's distribution approaches a normal distribution as n→∞. | Central Limit Theorem |
- Consistency: This property implies that as the sample size n→∞, the OLS estimators for coefficients (β^OLS) and error variance (σ^OLS2) converge in probability to their true values, β and σ2, respectively: β^OLSpβ and σ^OLS2pσ2.
- Asymptotic normality: This property states that the sampling distribution of the OLS estimator, when appropriately scaled, converges in distribution to a normal distribution: n(β^OLS−β)dN(0,σ2Q−1), where Q=E[XiXi⊤] 26.
5.2 Simulation example
A simulation can illustrate the large sample properties of OLS estimators by generating multiple datasets for varying sample sizes and observing the distribution of the estimated coefficients 27.
📝 A simulation involves setting a sample size n (e.g., 20, 100, 500) and generating a large number of datasets (e.g., 1000) for each n. For each dataset, OLS coefficients are estimated. The distribution of these estimated coefficients across the simulations demonstrates how consistency and asymptotic normality manifest with increasing sample size 27.

The simulation results show that as the sample size increases, the distribution of the estimated coefficients becomes more concentrated around the true value, illustrating consistency. Furthermore, the shape of the distribution increasingly resembles a normal distribution, confirming asymptotic normality 28 29.

6. Goodness–of–fit
6.1 Decomposition of total sum of squares
The total sum of squares (TSS) represents the total variation in the response variable, which can be decomposed into the explained sum of squares (ESS) and the residual sum of squares (RSS). This decomposition is valid only when an intercept is included in the linear regression model, ensuring that the residuals sum to zero 31.
- Total sum of squares (TSS): Measures the total variation of the observed response values (Yi) around their mean (Yˉ). TSS=∑i=1n(Yi−Yˉ)2
- Explained sum of squares (ESS): Represents the variation in the response variable that is explained by the regression model. ESS=∑i=1n(Y^i−Yˉ)2
- Residual sum of squares (RSS): Quantifies the unexplained variation, or the sum of squared differences between the observed and predicted response values. RSS=∑i=1n(Yi−Y^i)2
- Decomposition relationship: The total variation is the sum of the explained and unexplained variations. TSS=ESS+RSS
6.2 Coefficient of multiple determination (R2)
The coefficient of multiple determination (R2) quantifies the proportion of the total variation in the response variable that is explained by the linear regression model 32.
- Definition: R2 is calculated as the ratio of ESS to TSS, or equivalently, 1 minus the ratio of RSS to TSS. R2=TSSESS=1−TSSRSS
- Range: The value of R2 always falls between 0 and 1.
- Interpretation: A higher R2 indicates that a larger proportion of the variance in the dependent variable is predictable from the independent variables.
- Simple linear regression: For a simple linear regression model, R2 is equal to the squared sample correlation between the observed response values and the independent variable.
- Model complexity: R2 never decreases when additional parameters are added to the model, even if those parameters do not significantly improve the model's explanatory power.

6.3 Adjusted coefficient of multiple determination (Rˉ2)
The adjusted coefficient of multiple determination (Rˉ2) corrects for the number of parameters in the model, providing a more accurate measure of fit when comparing models with different numbers of predictors 32.
- Formula: Rˉ2 adjusts R2 by incorporating the degrees of freedom for both the residuals and the total variation. Rˉ2=1−TSS/(n−1)RSS/(n−p)
- n: number of observations.
- p: number of parameters in the model.
- Model comparison: Rˉ2 is particularly useful for comparing different models, as it penalizes models for including unnecessary predictors.
- Behavior: Unlike R2, Rˉ2 can decrease if newly added parameters do not improve the model sufficiently to offset the penalty for increased complexity 32.
📝 If adding a new predictor to a model increases R2 but the improvement is not significant enough, Rˉ2 can decrease, as it penalizes for the increased number of parameters p 32.
7. Hypothesis testing
7.1 Confidence intervals for regression coefficients
Under the assumption of normally distributed error terms, ϵ∣X∼N(0,σ2In), the ordinary least squares (OLS) estimator for each regression coefficient, β^j,OLS, is also normally distributed: β^j,OLS∣X∼N(βj,σ2(XTX)jj−1) for j=1,…,p. This allows for the construction of confidence intervals for individual coefficients 34.
A (1−α)100% confidence interval for each βj is given by:

📝 If a 95% confidence interval for βj is calculated, it means that if the estimation process were repeated many times, 95% of these intervals would contain the true value of βj.
7.2 Individual coefficient hypothesis testing (t-test)
To test hypotheses about individual regression coefficients, specifically whether a coefficient is significantly different from zero, a t-test is employed. This test relies on the t-distribution under the null hypothesis 35.
The hypothesis test for an individual coefficient βj is formulated as:
- Null Hypothesis (H0): βj=0 (the coefficient has no effect on the dependent variable).
- Alternative Hypothesis (Ha): βj=0 (the coefficient has a significant effect).
Under the assumptions (A1)-(A5) and H0, the t-statistic is calculated as: t=SE(β^j,OLS∣X)β^j,OLS∼tn−p Where SE(β^j,OLS∣X)=σ^OLS2(XTX)jj−1 35.
The decision to reject H0 can be made using either the critical value approach or the p-value approach:
| Method | Rejection Criterion |
|---|---|
| Critical Value | Reject H0 if ∣t∣>t1−2α,n−p |
| p-value | Reject H0 if p-value <α |
The p-value is calculated as 2P(T>∣t∣), where T∼tn−p 35.
7.3 Partial F-test for groups of parameters
When testing the significance of a group of q parameters simultaneously, a partial F-test is used. This test compares the residual sum of squares (RSS) of a full model to that of a reduced model where the q parameters are constrained to zero 36.
The hypotheses for testing a group of parameters (e.g., the last q parameters) are:
- Null Hypothesis (H0): βp−q+1=⋯=βp=0 (the group of coefficients has no collective effect).
- Alternative Hypothesis (Ha): At least one of βp−q+1,…,βp=0 (at least one coefficient in the group has a significant effect).
Under H0, the reduced model is Yi=β1+⋯+βp−qXi,p−q+ϵi. Let RSSp−q be the RSS of the reduced model and RSS be the RSS of the full model.
Under assumptions (A1)-(A5) and H0, the F-statistic is: F=RSS/(n−p)(RSSp−q−RSS)/q∼Fq,n−p
📝 To test if the variable 'stores' is significant in a regression model, one would fit a reduced model without 'stores' and a full model with 'stores', then use
anova(fitreduced, fit)to perform the partial F-test 37.
7.4 Overall F-test
The overall F-test assesses whether the entire regression model, excluding the intercept, explains a significant amount of variation in the dependent variable. It is a special case of the partial F-test where q=p−1 38.
The hypotheses for the overall F-test are:
- Null Hypothesis (H0): β2=⋯=βp=0 (all regression coefficients, except the intercept, are zero).
- Alternative Hypothesis (Ha): At least one of β2,…,βp=0 (at least one regression coefficient is non-zero).
This test determines if the model explains more variation than an intercept-only model. The F-statistic can be expressed in terms of the explained sum of squares (ESS) and RSS, or in terms of the coefficient of determination (R2): F=RSS/(n−p)ESS/(p−1)∼Fp−1,n−p This is equivalent to: F=(1−R2)/(n−p)R2/(p−1) 38.
8. Prediction
8.1 Confidence interval for the mean response
A confidence interval (CI) for the mean response estimates the expected value of the response variable at a specific set of predictor values, x0=(x1,…,xp)⊤. The mean response is given by x0⊤β, and its unbiased estimator is y^0=x0⊤β^OLS 41.
Under the assumption of normal errors, the confidence interval for the mean response is constructed as follows:
The formula indicates that the interval accounts for the uncertainty in estimating the mean response, but not the inherent variability of individual observations 41.
8.2 Prediction interval for the unknown response
A prediction interval (PI) for an unknown response y0=x0⊤β+ϵ0 estimates the range within which a single future observation will fall at a specific set of predictor values. This interval is inherently wider than a confidence interval for the mean response because it incorporates both the uncertainty in estimating the mean and the irreducible error variance (ϵ0) of individual observations 41.
The prediction interval for the unknown response is calculated using the formula: y^0±t1−2α,n−p×σ^OLS1+x0⊤(X⊤X)−1x0
📝 For a house with specific features (1 km from a train station, 0 years old, 6-10 stores nearby), the average cost might be 334,236 ± 17,288 New Taiwan Dollar/Ping (CI), while a specific house with these features could cost 334,236 ± 127,921 New Taiwan Dollar/Ping (PI). This demonstrates the significantly wider range of the prediction interval due to the additional uncertainty of an individual observation 42.
| Interval Type | Purpose | Formula Component |
|---|---|---|
| Confidence Interval (CI) | Estimates the mean response x0⊤β | σ^OLSx0⊤(X⊤X)−1x0 |
| Prediction Interval (PI) | Estimates a single unknown response y0 | σ^OLS1+x0⊤(X⊤X)−1x0 |
The key distinction between the two intervals lies in the additional '1' under the square root in the PI formula, which accounts for the variance of the new observation ϵ0 41.
9. Violations of assumptions
9.1 Endogeneity
Endogeneity occurs when the assumption that the error term's conditional expectation given the regressors is zero, E[ϵ∣X]=0, is violated. This often arises due to unobserved confounders affecting both the dependent variable (Y) and an independent variable (X), leading to omitted variable bias 44.
- Impact on OLS: The Ordinary Least Squares (OLS) estimator becomes biased and inconsistent, meaning its estimates do not converge to the true population parameters even with an infinite sample size.
- Detection: Endogeneity cannot be directly tested without additional assumptions.
- Solution: Instrumental variable (IV) methods are a possible approach to address endogeneity 44.
📝 If a model predicting house prices omits "living space (m2)" and larger houses are generally further from a train station, the effect of "distance to train station" might be underestimated. This is because living space, an unobserved confounder, correlates with both house price and distance to the train station 44.
9.2 Heteroscedasticity
Heteroscedasticity is the violation of the assumption that the error variance is constant across all observations, i.e., Var(ϵi∣X)=σi2 for i=1,…,n. This means the variance of the error term differs for different values of the independent variables 45.
- Impact on OLS: OLS remains unbiased and consistent under heteroscedasticity, but it is no longer efficient. The standard OLS estimator of the variance-covariance matrix, σ^OLS2(XTX)−1, might be a biased estimator of Var(β^OLS∣X).
- Detection: Heteroscedasticity can often be detected by plotting residuals against fitted values or individual independent variables. Standardized residuals are preferred for better comparability.

- Visual interpretation:
- Fitted values vs. standardized residuals: A changing vertical spread of residuals indicates heteroscedasticity 45 52.
- Independent variables vs. standardized residuals: Plots against individual predictors can reveal if the spread of residuals changes with specific variables. Systematic curvature might also suggest functional-form misspecification 47 48 50.
- Boxplots: Boxplots of standardized residuals across categories of an independent variable can show differing spreads, indicating heteroscedasticity 49 55.
📝 In a house price model, if the plot of standardized residuals against "distance to train" shows a noticeably changing vertical spread, it suggests heteroscedasticity. Additionally, systematic curvature in this plot could indicate that the functional form for "distance to train" is misspecified, potentially requiring the inclusion of a quadratic term like distance_to_train2 50 51.
9.3 Heteroscedasticity-consistent estimators
To address heteroscedasticity, a heteroscedasticity-consistent estimator of Var(β^OLS∣X) can be used. This approach corrects the standard errors without changing the estimated coefficients 56 58.
- Variance under heteroscedasticity: The true variance of the OLS estimator is given by Var(β^OLS∣X)=(XTX)−1XTΩX(XTX)−1, where Ω=diag(σ12,…,σn2) is a diagonal matrix of unknown conditional error variances 56.
- Estimation of Ω: Since the σi2 values are unknown, they must be estimated. Different heteroscedasticity-consistent estimators use various methods to estimate Ω.
- HC3 correction: A common choice for estimating σi2 is the HC3 correction, defined as σ^i2=(1−hii)2ϵ^i2, where ϵ^i is the OLS residual and hii=XiT(XTX)−1Xi is the leverage of observation i.
- Leverage (hii): A high value of hii indicates that observation i has an unusual combination of covariate values, meaning it has a strong influence on the fitted values 57.
- Implementation: Software packages like
sandwichandlmtestin R can compute heteroscedasticity-consistent standard errors using functions likevcovHC58.
📝 After fitting a linear model
fitsq, applyingcoeftest(fitsq, vcov. = vcovHC(fitsq, type = "HC3"))will re-estimate the standard errors using the HC3 correction. This will result in changed standard errors, but the estimated coefficients themselves will remain the same 58.
9.4 Autocorrelation
Autocorrelation, or serial correlation, occurs when the error terms are correlated across observations, violating the assumption Cov(ϵi,ϵj∣X)=0 for i=j. This is particularly common in time series data 59.
- Impact on OLS: The OLS estimator remains unbiased and consistent, but it is no longer the Best Linear Unbiased Estimator (BLUE). The standard variance estimator Var(β^OLS∣X)=σ2(XTX)−1 is incorrect.
- Solutions: Solutions are similar to those for heteroscedasticity, often involving robust standard errors or specialized time series models 59.
📝 When analyzing time series data such as stock prices, inflation rates, or GDP, the error term at one time point might be correlated with the error term at a previous time point. This violates the independence assumption of OLS residuals and indicates autocorrelation 59.
9.5 Multicollinearity
Multicollinearity arises when independent variables in a regression model are highly correlated with each other. Perfect multicollinearity occurs if one predictor is a perfect linear combination of others, leading to rank(X)<p, where p is the number of predictors 60.
- Impact on OLS:
- Perfect multicollinearity: The OLS solution is not unique, and the coefficients cannot be estimated.
- High correlation: Even without perfect multicollinearity, high correlation among predictors leads to a high variance of the estimated coefficients because (XTX) becomes close to singular. This makes the interpretation of individual regression coefficients more difficult.
- Detection:
- Pairwise correlations: Large pairwise correlations between independent variables can indicate multicollinearity 60.
- Variance Inflation Factors (VIF): VIFs are a formal method to detect more general linear dependencies among predictors 61.
📝 If a model includes both "square footage" and "number of rooms" as predictors for house price, and these two variables are highly correlated (e.g., larger houses almost always have more rooms), multicollinearity may be present. This makes it difficult to isolate the individual effect of each variable on house price 60.
9.6 Variance inflation factors (VIF)
The Variance Inflation Factor (VIF) quantifies how much the variance of an estimated regression coefficient is inflated due to multicollinearity 61.
- Calculation: For each independent variable j, VIFj=1−Rj21, where Rj2 is the coefficient of multiple determination from a regression of the j-th independent variable on all other independent variables (including an intercept) 61.
- Interpretation:
- VIFj=1: Indicates no linear relationship with other regressors.
- VIFj>1: Generally observed in practice.
- Rule of thumb: A VIFj>10 typically indicates strong multicollinearity 62.
- Generalized VIFs (GVIFs): For models with categorical variables, generalized VIFs are used. A common rule of thumb for GVIFs is that GVIF1/(2df)>3 indicates strong multicollinearity 63.
| VIF Value | Interpretation |
|---|---|
| VIFj=1 | No linear relationship with other regressors |
| VIFj>1 | Some degree of multicollinearity present |
| VIFj>10 | Strong multicollinearity (rule of thumb) |
| GVIF1/(2df)>3 | Strong multicollinearity for categorical variables (rule of thumb) |
- Solutions:
- Dropping variables: One or more variables with high VIFs can be dropped, but this risks omitted variable bias if the dropped variable is important.
- Principal Component Analysis (PCA): PCA offers an alternative approach to deal with multicollinearity by transforming correlated variables into a set of uncorrelated principal components 63.
📝 If a
vif(fitsq)command in R returns a VIF value of 15 for a particular predictor, it suggests strong multicollinearity for that variable, as it exceeds the common threshold of 10. For a categorical variable likestores, if its GVIF1/(2df) value is 4, it also indicates strong multicollinearity 62 63.
10. Error terms are non-normal
10.1 Violation of assumption (A5): Error terms are non-normal
When the assumption (A5) that error terms are normally distributed, ϵ∣X∼N(0,σ2In), is violated, the Ordinary Least Squares (OLS) estimator still exhibits asymptotic normality due to the Central Limit Theorem (CLT). This property allows for the construction of asymptotically valid confidence intervals for each regression coefficient βj 64.
- Confidence interval formula: The confidence interval for βj is given by bβj,OLS±z1−α/2×SE(bβj,OLS∣X), where z1−α/2 is the (1−α/2) quantile of the standard normal distribution.
- Standard error of OLS estimator: The standard error for the j-th OLS estimator is calculated as SE(bβj,OLS∣X)=bσOLS(X⊤X)jj−1.
- Sample size requirement: For the asymptotic normality to hold, the sample size n must be sufficiently large, as t1−α/2,n−p converges to z1−α/2 as n→∞ 64.

10.2 Visual assessment of normality using Q-Q plots
The normality assumption (A5) can be visually assessed by plotting sample quantiles against theoretical normal quantiles, which is known as a Q-Q plot 65.
- Interpretation of Q-Q plot:
- If the points on the Q-Q plot approximately follow a straight line, particularly through the middle of the distribution, the normality assumption is likely satisfied.
- Strong systematic curvature, heavy tails, or extreme residuals far from the line indicate a violation of the normality assumption 65.
📝 A Q-Q plot generated from residuals (e.g.,
res = resid(fitsq)) can be visualized usingqqnorm(res)andqqline(res)commands, whereqqlineadds a reference line for comparison 66.

11. Limited dependent variables
11.1 Introduction to limited dependent variables
Limited dependent variables refer to outcome variables (Yi) that are restricted in their possible values, deviating from the continuous, unbounded nature assumed by standard linear regression models. These restrictions necessitate specialized modeling approaches to ensure valid predictions and inferences 67.
- Binary outcomes: The dependent variable can only take on two values, such as 0 or 1 (e.g., success/failure, yes/no).
- Count outcomes: The dependent variable represents counts of events, typically non-negative integers (e.g., number of arrests, number of children).
- Censored outcomes: The dependent variable's true value is observed only within a certain range, with values outside this range being recorded at a boundary (e.g., income reported up to a certain maximum, time to event observed only until study end).
- Truncated outcomes: Observations are entirely missing if the dependent variable falls outside a specific range, unlike censoring where the boundary value is known.
📝 In a study examining factors influencing college admission, the dependent variable "admission status" is binary (admitted/not admitted). Using a linear regression model would be inappropriate because it could predict probabilities outside the range, which are nonsensical for a binary outcome. Specialized models like logistic regression are required 1.
12. Limited dependent
12.1 Introduction to limited dependent variables
Limited dependent variables are outcomes that are restricted in the values they can take, deviating from the continuous assumption of Yi∈R typically found in standard linear regression models. These variables necessitate specialized modeling approaches because linear regression can produce impossible or nonsensical predictions for such outcomes 69.
| Type of Limited Dependent Variable | Description | Example |
|---|---|---|
| Binary Data | Outcome can only take one of two discrete values. | Default or no default (Yi∈{0,1}) |
| Count Data | Outcome represents a non-negative integer count. | Number of loans (Yi∈{0,1,2,…}) |
| Censored Data | Outcome is observed only under certain conditions, with values outside these conditions being unobserved or truncated. | Unemployment duration (observed only if employed before study end) |
📝 If a linear regression model were used to predict the probability of loan default, it might yield predictions outside the [0,1] range, such as −0.2 or 1.3, which are impossible for a probability 69.
13. Logistic regression
13.1 Limitations of linear regression for binary outcomes
Linear regression models are unsuitable for binary dependent variables due to violations of key assumptions and the potential for predicted probabilities outside the [0,1] range. When the dependent variable Yi∈{0,1}, the expected value E[Yi∣Xi] directly represents the probability P(Yi=1∣Xi)=Xi⊤β 73.
- Predicted probabilities: Linear regression can yield predicted probabilities less than 0 or greater than 1, which are nonsensical for probabilities 73.
- Error term distribution: The conditional distribution of the error term ϵi is discrete, taking only two possible values: −Xi⊤β (when Yi=0) or 1−Xi⊤β (when Yi=1).
- Heteroscedasticity: The variance of the error term is not constant and depends on the predictor variables, specifically Var(ϵi∣Xi)=Xi⊤β(1−Xi⊤β), violating the homoscedasticity assumption 74.

13.2 Binary choice models
Binary choice models are designed to model the probability of choosing between two discrete alternatives, where the dependent variable Yi∈{0,1}. These models express the probability P(Yi=1∣Xi) as a function G(Xi,β), typically using a cumulative distribution function F(⋅) to ensure probabilities lie between 0 and 1 76.
- General form: P(Yi=1∣Xi)=G(Xi,β)=F(Xi⊤β) 76.
- Latent variable model: Binary choice models can be derived from an unobserved (latent) variable Yi∗=Xi⊤β+ϵi, where Yi=1 if Yi∗>0 and Yi=0 otherwise. The choice of distribution for ϵi determines the specific form of F(⋅) 77.

| Model | Distribution Function F(w) |
|---|---|
| Probit model | ∫−∞w2π1exp(−21t2)dt |
| Logit model | 1+exp{w}exp{w} |
- Logistic vs. Probit: The logistic distribution has slightly heavier tails than the normal distribution used in the Probit model. While estimated coefficients differ due to scale, both models generally yield similar fitted probabilities 76.
13.3 The logit model and interpretation
The logit model is a specific binary choice model that uses the logistic distribution function to link the linear predictor Xi⊤β to the probability of the outcome Yi=1 78.
- Probability formula: The probability Pi=P(Yi=1∣Xi) is given by Pi=1+exp{Xi⊤β}exp{Xi⊤β}=1+exp{−Xi⊤β}1.
- Log odds: The logit transformation of Pi is the log odds of Yi=1, defined as log(1−PiPi)=Xi⊤β. Here, 1−PiPi represents the odds of Yi=1 78.

- Odds ratio: For a one-unit increase in an independent variable Xij (holding other variables constant), the log odds increase by βj, and the odds are multiplied by exp(βj). This exp(βj) is known as the odds ratio.
- Interpretation: Odds ratios describe changes in odds, not direct changes in probabilities. For example, if βj=0.1, the odds are multiplied by exp(0.1)≈1.105, indicating an approximate 10.5% increase in odds 79.
📝 If the probability Pi=2/3, the odds are 1−2/32/3=1/32/3=2. If the odds are 4, then 1−PiPi=4, which implies Pi=4/5 79.
13.4 Application to credit risk data
Logistic regression can be applied to model credit risk, where the dependent variable riskbin is a binary indicator (0 = good risk, 1 = bad risk). Independent variables include age, marital status, income, mortgage, and number of loans 71.
- Data preprocessing:
ageandincomeare standardized, andriskis recoded toriskbin(0 for good, 1 for bad).nr_loansis treated as numeric, assuming a linear effect on risk 71. - Model fitting in R: The
glm()function withfamily = binomialis used to fit a logistic regression model in R 80.
fitlog = glm(riskbin~agestd+marital+incomestd+mortgage+nr_loans, data=risk, family = binomial) summary(fitlog)

- Coefficient interpretation: The coefficients from the
glmoutput represent the change in the log odds of being a "bad risk" for a one-unit increase in the corresponding predictor, holding other variables constant 81.
| Variable | Effect on Log Odds | Effect on Odds |
|---|---|---|
| agestd (one-unit increase) | Decreases by 1.403 | Odds decrease |
| marital (other to married) | Decreases by (−2.918−1.717) | Odds decrease by approx. 99% (exp(−4.635)≈0.01) |
| nr_loans (2 to 1, i.e., -1 unit) | Increases by 1.785 | Odds increase by a factor of exp(1.785)≈5.96 |
- Example interpretation: If
agestdincreases by one unit, the log odds of being a bad risk decrease by 1.403. If marital status changes from 'other' to 'married', the odds of being a bad risk decrease by approximately 99% 81.
14. X i = 0.
14.1 Maximum likelihood estimation
Maximum Likelihood Estimation (MLE) is the primary method for estimating parameters in logit models, assuming the conditional distribution of the dependent variable Y given independent variables X is known up to a finite number of unknown parameters 83.
- Conditional distribution: The function F(Yi∣Xi;θ) is assumed to be known, where θ represents the unknown parameters to be estimated.
- Examples of distributions:
- Linear regression: Yi∣Xi∼N(Xi⊤β,σ2), with β and σ2 unknown.
- Logistic regression: Yi∣Xi∼Bernoulli(Pi), with Pi=1+exp{Xi⊤β}exp{Xi⊤β} and β unknown 83.

14.2 Likelihood function
The likelihood function, L(θ), represents the joint conditional density or probability of observing a sample of n independent and identically distributed (i.i.d.) observations {Yi,Xi}i=1n 84 85.
- Definition: L(θ)=∏i=1nLi(θ)=∏i=1nf(Yi∣Xi;θ), where Li(θ) is the likelihood contribution of observation i.
- Interpretation: It treats the observed data as fixed and varies the parameter θ.
- Estimation: The MLE for θ, denoted θ^MLE, is found by maximizing the likelihood function, or equivalently, the log-likelihood function, which is often computationally simpler.
- θ^MLE∈argmaxθ∈ΘlogL(θ)=argmaxθ∈Θ∑i=1nlogLi(θ) 85.

14.3 Score vector and first-order conditions
The score vector, s(θ), is the first derivative of the log-likelihood function with respect to the parameter vector θ 86.
- Definition: s(θ)=∂θ∂logL(θ)=∑i=1n∂θ∂logLi(θ)=∑i=1nsi(θ), where si(θ) is the score contribution of observation i.
- First-order conditions: At the MLE estimate θ^MLE, the score vector must be equal to zero: s(θ^MLE)=∑i=1nsi(θ^MLE)=0.
- Generalized residuals: The individual score contributions si(θ^MLE) can be interpreted as generalized residuals 86.

14.4 Example 1: Linear regression
For a linear regression model under Gaussian Markov (GM) conditions, where ϵ∣X∼N(0,σ2In), the conditional distribution is Yi∣Xi∼N(Xi⊤β,σ2) 87.
-
Log-likelihood function: logL(β,σ2)=−2nlog(2πσ2)−2σ21∑i=1n(Yi−Xi⊤β)2 This is derived from the probability density function f(Yi∣Xi;β,σ2)=2πσ21exp{−2σ2(Yi−Xi⊤β)2}.
-
First-order condition for β: ∂β∂logL(β,σ2)=σ21∑i=1nXi(Yi−Xi⊤β)=σ21X⊤ϵ 87.

-
MLE estimators:
| Parameter | MLE Estimator |
|---|---|
| β | bβMLE=(X⊤X)−1X⊤Y |
| σ2 | bσMLE2=n−1∑i=1n(Yi−Xi⊤bβMLE)2 |
The MLE estimator for β is equivalent to the Ordinary Least Squares (OLS) estimator, bβMLE=bβOLS. The MLE estimator for σ2 is related to the OLS estimator by bσMLE2=nn−pbσOLS2, where p is the dimension of Xi.
- Bias of σ^MLE2: The expected value of σ^MLE2 conditional on X is E[σ^MLE2∣X]=nn−pσ2, indicating that σ^MLE2 is a consistent but downward-biased estimator 88.

14.5 Example 2: Logistic regression
In a logistic regression model, the probability Pi is defined as Pi=1+exp{Xi⊤β}exp{Xi⊤β} 89.
-
Likelihood contribution: For observation i, the likelihood contribution is Pi if Yi=1 and 1−Pi if Yi=0.
-
Likelihood function: L(β)=∏i=1nPiYi(1−Pi)1−Yi.
-
Log-likelihood function: logL(β)=∑i=1n[YiXi⊤β−log(1+exp{Xi⊤β})] 89.

-
First-order conditions: The derivative of the log-likelihood with respect to β is set to zero to find β^MLE: ∂β∂logL(β)=∑i=1n[Yi−1+exp{Xi⊤β}exp{Xi⊤β}]Xi=0 This implies ∑i=1nYiXi=∑i=1nP^iXi, where P^i=1+exp{Xi⊤β^MLE}exp{Xi⊤β^MLE} 90.
-
Interpretation of first-order conditions:
-
If Xi includes an intercept, then ∑i=1nYi=∑i=1nP^i, meaning the predicted frequency equals the observed frequency.
-
If Xi includes an intercept and a dummy variable, the predicted frequency equals the observed frequency for each level of the dummy.
-
If Xi only contains an intercept, then P^i=Yˉ, and β^1,MLE=log(1−YˉYˉ).
📝 Consider a logistic regression model with only an intercept. The first-order conditions imply that the estimated probability P^i for each observation is equal to the sample mean of the dependent variable, Yˉ. This leads to the intercept estimate β^1,MLE being the log-odds of the observed frequency 91.
15. Probit regression
15.1 Probit model formulation
Probit regression is an alternative to logistic regression for modeling binary outcomes, where the probability of the outcome is linked to a linear combination of predictors through the standard normal distribution function 92.
- Model definition: The probability Pi for an observation i is given by Φ(Xi⊤β), where Φ is the cumulative distribution function of the standard normal distribution.
- Likelihood function: The likelihood L(β) for the probit model is the product of these probabilities for all observations, incorporating the binary outcome Yi:
L(β)=∏i=1nΦ(Xi⊤β)Yi(1−Φ(Xi⊤β))1−Yi The log-likelihood is the sum of the logarithms of these terms 92.

15.2 Comparison with logistic regression
While probit and logit models generally yield similar fitted probabilities, their coefficient estimates differ due to a scaling factor 92.
- Coefficient interpretation: Probit coefficients are not directly comparable to logit coefficients because they are on different scales, reflecting the use of the standard normal CDF versus the logistic CDF 93.
- Predicted probabilities: Despite coefficient differences, the predicted probabilities from both models are often very similar, especially for probabilities not close to 0 or 1 94.
| Model | Predicted Probability 1 | Predicted Probability 2 |
|---|---|---|
| Logistic regression | 0.385 | 0.952 |
| Probit regression | 0.413 | 0.954 |
📝 When predicting the probability of a binary outcome for two hypothetical cases using both logistic and probit models, the predicted probabilities are numerically close, such as 0.385 versus 0.413 for the first case and 0.952 versus 0.954 for the second case 94.
16. General properties
16.1 Maximum likelihood estimator properties
Maximum Likelihood Estimators (MLEs) possess several desirable asymptotic properties under weak regularity conditions, assuming a correctly specified likelihood function and independent and identically distributed (i.i.d.) data 96.
| Property | Description |
|---|---|
| Consistency | The MLE converges in probability to the true parameter value: θ^MLEpθ |
| Asymptotic normality | The MLE, when scaled, follows a normal distribution: n(θ^MLE−θ)dN(0,V) |
| Asymptotic efficiency | As n→∞, the MLE achieves the smallest variance among all consistent asymptotically normal estimators |
16.2 Fisher information matrix
The Fisher information matrix, I(θ), is crucial for determining the asymptotic covariance matrix V of the MLE, where V=I(θ)−1 96.
- Definition: It is defined as the negative expected value of the second derivative of the log-likelihood function: I(θ)=−E[∂θ∂θ⊤∂2logLi(θ)] 96.
- Curvature: The Fisher information matrix reflects the curvature of the log-likelihood function around the true parameter θ.
- Variance relationship: A greater absolute curvature implies larger Fisher information and, consequently, a smaller asymptotic variance for the MLE 97.

📝 If the log-likelihood function has a sharp peak, its curvature is high, indicating that the parameter is precisely estimated, leading to high Fisher information and low variance. Conversely, a flat log-likelihood suggests high uncertainty and low Fisher information.

16.3 Cramér–Rao lower bound
The inverse of the Fisher information matrix, I(θ)−1, represents the Cramér–Rao lower bound, which is the theoretical lower limit on the asymptotic covariance matrix for any consistent, asymptotically normal estimator in a parametric model 98.
- OLS efficiency: Under the normal linear regression model and Gauss-Markov conditions, the Ordinary Least Squares (OLS) estimator for β attains this Cramér–Rao lower bound, indicating its asymptotic efficiency 98.
16.4 Estimating the asymptotic covariance matrix
The asymptotic covariance matrix can be consistently estimated using two primary methods, which generally do not yield identical results 99.
- Hessian matrix method (V^H): This method uses the observed Hessian matrix (matrix of second-order derivatives of the log-likelihood function) evaluated at the MLE 98.
V^H=(−n1∑i=1n∂θ∂θ⊤∂2logLi(θ)θ=θ^MLE)−1

- Gradient method (V^G): If the likelihood function is correctly specified, the expected value of the outer product of the score vectors, J(θ)=E[si(θ)si(θ)⊤], is equal to the Fisher information I(θ). This allows for an alternative estimation using the gradient (vector of first-order derivatives) 99.
V^G=(n1∑i=1nsi(θ^MLE)si(θ^MLE)⊤)−1

17. Goodness–of–fit
17.1 Residual deviance
The residual deviance (Dres) quantifies the discrepancy between a model of interest and a perfectly fitting saturated model, analogous to the Residual Sum of Squares (RSS) in linear models 101 102.
- Saturated model: A model with sufficient free parameters to perfectly fit the observed data, yielding the largest achievable log-likelihood, denoted as logL(θ^MLE,s).
- Logistic regression: For binary outcomes (Yi∈{0,1}), the saturated model implies P^i=Yi, and its log-likelihood logL(θ^MLE,s)=0.
- Formula: Dres=2[logL(θ^MLE,s)−logL(θ^MLE)], where θ^MLE are the fitted parameters of the model of interest.
- Property: Dres≥0, indicating that the model of interest cannot fit the data better than the saturated model 101.
17.2 Null deviance
The null deviance (Dnull) measures the distance between an intercept-only model and a perfect fit, serving a similar role to the Total Sum of Squares (TSS) in linear models 102.
- Intercept-only model: A baseline model that includes only an intercept term, with its estimated parameter denoted as θ^MLE,0.
- Formula: Dnull=2[logL(θ^MLE,s)−logL(θ^MLE,0)].
- Purpose: It provides a benchmark for assessing how much better a more complex model performs compared to a very simple one 102.
17.3 Pseudo-R2
The pseudo-R2, also known as the likelihood ratio index, is a measure for logistic regression that is analogous to R2 in linear models, quantifying the proportion of null deviance explained by the fitted model 103.
- Formula: pseudo-R2=1−DnullDres=1−logL(θ^MLE,0)logL(θ^MLE).
- Interpretation: A higher pseudo-R2 indicates that the model explains a larger proportion of the variability in the outcome compared to the intercept-only model.
- Limitation: Pseudo-R2 never decreases when additional parameters are included, which can lead to overfitting; thus, information criteria are often preferred for model comparison 103.
📝 If a logistic regression model yields a pseudo-R2 of 0.785, it implies that the model explains 78.5% of the null deviance, indicating a substantial improvement over an intercept-only model 105.
17.4 Information criteria
Information criteria, such as AIC and BIC, are used for model comparison by penalizing model complexity, addressing the limitation of pseudo-R2 which does not account for the number of parameters 103 104.
- K: Represents the total number of parameters in the model.
- Preference: Lower values of AIC and BIC are preferred when comparing models, particularly during variable selection 104.
| Criterion | Formula | Focus |
|---|---|---|
| Akaike Information Criterion (AIC) | 2K−2logL(θ^MLE) | Prediction |
| Bayesian Information Criterion (BIC) | log(n)K−2logL(θ^MLE) | Identifying the true model |
18. Hypothesis testing
18.1 The Wald test
The Wald test is a statistical test used to evaluate the significance of individual regression coefficients or linear combinations of coefficients in a generalized linear model, based on the asymptotic normality of the maximum likelihood estimator (MLE) 107.
- Hypothesis: The test assesses hypotheses of the form H0:θk=r for a single parameter, or more generally, H0:Cθ=Q for multiple parameters, where C is a full-rank matrix and Q is a vector.
- Test statistic: The Wald test statistic, UW, follows an asymptotic chi-squared distribution under the null hypothesis, with degrees of freedom equal to the number of restrictions (q) 107.
- Estimation requirement: This test only requires the estimation of the unrestricted model 108.

📝 To test the significance of the
maritalvariable in a logistic regression model, represented by H0:β3=β4=0, a Wald test yields UW=16.3 with a p-value less than 0.001, indicating strong evidence against the null hypothesis 110.
18.2 The likelihood ratio test
The likelihood ratio (LR) test compares the log-likelihoods of two nested models: a full model and a restricted model under the null hypothesis 108.
- Test statistic: The LR test statistic, ULR, is twice the difference between the log-likelihood of the unrestricted model and the log-likelihood of the restricted model.
- Distribution: Under the null hypothesis H0:Cθ=Q, ULR asymptotically follows a chi-squared distribution with q degrees of freedom.
- Computation: This test is straightforward to compute but necessitates estimating both the full (unrestricted) and the reduced (restricted) models 108.
📝 For the
maritalvariable significance test (H0:β3=β4=0), the LR test statistic ULR=22.1 with a p-value less than 0.001, suggesting that themaritalvariable significantly contributes to the model 111.
18.3 The score test
The score test, also known as Rao's test, evaluates the null hypothesis by examining the gradient of the log-likelihood function (the score vector) at the maximum likelihood estimates obtained under the restricted model 109.
- Test statistic: The score test statistic, USC, involves the score vector of the unrestricted model evaluated at the restricted MLE, and the inverse of the information matrix evaluated at the same point.
- Distribution: If H0:Cθ=Q, USC asymptotically follows a chi-squared distribution with q degrees of freedom.
- Estimation requirement: This test only requires the estimation of the restricted model under the null hypothesis 109.
📝 When testing H0:β3=β4=0 for the
maritalvariable, the score test yields USC=21.9 with a p-value less than 0.001, indicating that the restricted model is significantly worse than the full model 111.
18.4 Comparison of hypothesis tests
The Wald, Likelihood Ratio, and Score tests are distinct methods for hypothesis testing in generalized linear models, each with specific computational requirements and theoretical underpinnings 109.
| Test Type | Computational Requirement | Basis |
|---|---|---|
| Wald test | Estimates of the unrestricted model only | Asymptotic normality of MLE |
| Likelihood Ratio test | Estimates of both unrestricted and restricted models | Comparison of log-likelihoods |
| Score test | Estimates of the restricted model only | Score vector at restricted MLE |
- Asymptotic equivalence: Despite their differences in approach, these three tests are generally asymptotically equivalent, meaning they tend to produce similar results for large sample sizes 109.
19. Prediction
19.1 Predicting probabilities with logistic regression
Logistic regression models are used to predict the probability of an individual belonging to a specific category, such as being a "bad risk" customer. The model outputs a probability score, bP0, for each individual based on their characteristics 113.
📝 For a customer with characteristics x0⊤=(1,−1,0,1,−1,0,0), the predicted probability of being a bad risk customer is approximately 0.999. Conversely, for x0⊤=(1,2,1,0,1,1,0), the probability is approximately 0.001 113.
19.2 Classification and the confusion matrix
Individuals can be classified into risk categories by comparing their predicted probability (bPi) against a chosen threshold (c). If bPi>c, the individual is classified as "bad risk".
The performance of this classification is evaluated using a confusion matrix, which summarizes the counts of correct and incorrect predictions against actual outcomes 114.

| Metric | Formula |
|---|---|
| Error rate | (False Positives+False Negatives)/Total |
| Accuracy | (True Positives+True Negatives)/Total |
📝 With a threshold c=0.5, a confusion matrix might show 115 actual good customers predicted as good, 7 actual bad customers predicted as good, 8 actual good customers predicted as bad, and 116 actual bad customers predicted as bad. This results in an error rate of (7+8)/246=0.061 and an accuracy of (115+116)/246=0.939 114.
19.3 Sensitivity and specificity
The general confusion matrix provides a framework for understanding classification outcomes, defining key metrics like sensitivity and specificity 115.

| Term | Definition |
|---|---|
| True Negatives (TN) | Correctly predicted negative outcomes |
| False Negatives (FN) | Incorrectly predicted negative outcomes (actual positive) |
| False Positives (FP) | Incorrectly predicted positive outcomes (actual negative) |
| True Positives (TP) | Correctly predicted positive outcomes |
- Sensitivity (recall): This is the proportion of actual positive cases that are correctly identified, calculated as TP/P, where P is the total number of actual positive cases.
- Specificity: This is the proportion of actual negative cases that are correctly identified, calculated as TN/N, where N is the total number of actual negative cases.
- Trade-off: There is an inherent trade-off between sensitivity and specificity as the classification threshold (c) changes 115.
19.4 Receiver Operating Characteristic (ROC) curve and AUC
The Receiver Operating Characteristic (ROC) curve is a graphical plot that illustrates the diagnostic ability of a binary classifier system as its discrimination threshold is varied. It plots sensitivity against 1-specificity (False Positive Rate) 115 116.

- Area Under the Curve (AUC): This metric quantifies the overall performance of a classifier, representing the probability that the model ranks a randomly chosen positive instance higher than a randomly chosen negative instance.
- Ideal performance: An ideal ROC curve hugs the top-left corner, indicating high sensitivity and high specificity, resulting in a larger AUC 117.
| AUC Value | Interpretation |
|---|---|
| 0.5 | Equivalent to random guessing |
| > 0.5 | Discriminates better than random |
| < 0.5 | Ranks classes in the wrong direction (predictions should be reversed) |
📝 An AUC of 0.9866 indicates excellent classifier performance, significantly better than random guessing. At a threshold of c=0.5, the sensitivity is approximately 0.943 and specificity is approximately 0.935. In credit risk, where classifying bad risk customers as good risk (False Negatives) is a major concern, decreasing the threshold to c=0.25 can increase sensitivity to approximately 0.959 while decreasing specificity to approximately 0.870 117 118.
20. The generalized linear model
20.1 Definition and structure of generalized linear models
Generalized Linear Models (GLMs) provide a flexible framework for modeling various types of response variables by extending ordinary linear regression. This framework assumes that the conditional expectation of the response variable, given the covariates, is related to a linear predictor through a link function 120.
- Core components:
- Linear predictor (Xi⊤β): A linear combination of the predictor variables and their coefficients.
- Link function (η): A function that transforms the expected value of the response variable to the linear predictor, such that η(E[Yi∣Xi])=Xi⊤β.
- Inverse link function (η−1): Transforms the linear predictor back to the expected value of the response, E[Yi∣Xi]=η−1(Xi⊤β).
- Exponential family distribution: The distribution of the response variable Yi given Xi must belong to the exponential family of distributions 120.
| Regression Type | Expected Value Formula | Link Function |
|---|---|---|
| Linear Regression | E[Yi∣Xi]=Xi⊤β | Identity (η(x)=x) |
| Logistic Regression | E[Yi∣Xi]=1+exp{Xi⊤β}exp{Xi⊤β} | Logit (η(p)=log(1−pp)) |
20.2 Poisson regression for count data
Poisson regression is a specific type of GLM used when the response variable represents count data, meaning it takes non-negative integer values 121.
- Poisson distribution:
- Probability mass function: P(Yi=k)=k!exp−λλk, for k=0,1,2,….
- Mean and variance: For a Poisson distribution, the mean and variance are equal, E[Yi]=Var(Yi)=λ, where λ>0.
- Modeling the mean: In Poisson regression, the mean λ is linked to the covariates through an exponential function: λ=E[Yi∣Xi]=expXi⊤β.
- Estimation: Model parameters (β) are typically estimated using maximum likelihood estimation 121.
📝 If a Poisson regression model yields a coefficient of -0.2642 for
incomestd, an increase of 1 unit inincomestdmultiplies the expected number of loans by exp(−0.2642)≈0.768. Similarly, if the coefficient formarital(single vs. married) is 0.27737, single individuals are expected to have exp(0.27737)≈1.32 times more loans than married individuals, representing a 32% increase 122.

21. Causal inference
21.1 Association versus causation
Causal inference focuses on determining the causal effect of one variable on another, distinguishing it from mere association between variables. Association implies a relationship, but not necessarily that one variable directly influences the other 124.
| Concept | Description |
|---|---|
| Association | Describes a relationship between two variables without implying direct influence. |
| Causation | Identifies a direct influence of one variable on another, where a change in one leads to a change in the other. |
📝 Wearing sunglasses is associated with eating ice cream, but neither causes the other; both are caused by the presence of the sun 125.
21.2 The fundamental problem of causal inference
The fundamental problem of causal inference arises because it is impossible to observe an individual's outcome under both treatment and control conditions simultaneously. For any given individual, we can only observe one of the potential outcomes 125.
- Policy evaluation: Causal inference is crucial for evaluating the effectiveness of policies, medical treatments, and interventions.
- Binary treatment: We are typically interested in the causal effect of a binary treatment, Zi∈{0,1}, on an outcome of interest, Yi 126.
21.3 Potential outcomes and counterfactuals
Potential outcomes define what an individual's outcome would be under different treatment assignments. Yi(1) represents the outcome if an individual receives the treatment (Zi=1), and Yi(0) represents the outcome if they do not (Zi=0) 127.
- Observed outcome: The observed outcome Yi is a function of the actual treatment received: Yi=Zi×Yi(1)+(1−Zi)×Yi(0).
- Counterfactual outcome: If Zi=0, then Yi(1) is the counterfactual outcome for individual i, representing what would have happened if they had received treatment. Conversely, if Zi=1, then Yi(0) is the counterfactual 127.
📝 For an individual participating in a job-training program, Yi(1) would be their earnings if they participated, and Yi(0) would be their earnings if they did not participate 127.
21.4 Stable-unit-treatment-value assumption (SUTVA)
SUTVA is a critical assumption in causal inference that ensures the treatment is well-defined and that an individual's outcome is only affected by their own treatment assignment. It comprises two main components 128.
| Assumption | Description |
|---|---|
| Consistency | The observed outcome Yi is precisely the potential outcome Yi(z) if the individual actually received treatment z. This implies no ambiguity in treatment definition. |
| No interference | An individual's outcome Yi(Z) is solely determined by their own treatment Zi, not by the treatments Zj received by other individuals j=i. |
- Implication: SUTVA ensures that there is only one version of treatment and that treatment assignment to one unit does not affect the outcomes of other units 128.
21.5 Identifiability of causal effects
Individual causal effects, such as Yi(1)−Yi(0), are generally not identifiable from observed data due to the fundamental problem of causal inference. Identifiability means that the causal effect can be uniquely determined from the observed data given a set of assumptions 129.
- Average treatment effect (ATE): Researchers often focus on aggregated causal effects, such as the average treatment effect (ATE), defined as E[Yi(1)−Yi(0)]. This represents the average difference in potential outcomes across the entire population.
- Assumptions for identification: Specific assumptions are required to identify different causal treatment effects, which then allow for estimation methods to be applied 129.
22. Randomized controlled trials
22.1 Definition and principles of RCTs
A randomized controlled trial (RCT) is a study design where individuals are randomly assigned to either a treatment group or a control group, ensuring that any observed differences between groups can be attributed to the treatment 130 131.
- Treatment randomization: This is represented by Zi⊥⊥(Yi(0),Yi(1)), indicating statistical independence between treatment assignment (Zi) and potential outcomes (Yi(0) for control, Yi(1) for treatment).
- Exchangeability: A direct consequence of treatment randomization, meaning that the treated and untreated groups are statistically equivalent in all aspects, both observed and unobserved, prior to treatment 131.
- This implies that treatment assignment does not systematically depend on an individual's expected performance with or without treatment.
- Violation occurs if treatment is deliberately assigned based on expected outcomes, such as giving treatment more often to individuals expected to perform poorly without it.
- Exchangeability does not mean Zi⊥⊥Yi, which would imply no causal effect of Zi on Yi 132.
22.2 Identification of the average treatment effect (ATE)
Under treatment exogeneity, which is achieved through randomization in RCTs, the Average Treatment Effect (ATE) can be directly identified from observed data. This is because any differences between groups are due to the treatment, and missing potential outcomes are solely due to chance 133.
- Treatment exogeneity: The treatment assignment is independent of potential outcomes, meaning the treatment is not influenced by factors that also affect the outcome.
- ATE identification: The ATE is defined as the expected difference between potential outcomes and can be estimated by the difference in observed means between the treated and control groups 133.

📝 In an RCT, if a new drug is randomly assigned, any observed difference in health outcomes between the drug group and the placebo group can be causally attributed to the drug. This is because randomization ensures that, on average, both groups were comparable in all other health-related factors before the drug was administered 133.
22.3 Statistical testing of ATE in RCTs
To test the null hypothesis that the ATE is zero (H0:ATE=0), a two-sample proportion Z-test can be employed, especially when the outcome is binary 135.
- Test statistic: Under the null hypothesis, the difference in sample proportions, normalized by the standard error, asymptotically follows a standard normal distribution. Yˉ(1−Yˉ)(n01+n11)Yˉ1−Yˉ0
- Variables:
- n1: Number of individuals in the treatment group.
- n0: Number of individuals in the control group.
- Yˉ1: Mean outcome in the treatment group.
- Yˉ0: Mean outcome in the control group.
- Yˉ: Overall mean outcome 135.
📝 In a randomized trial of streptomycin versus placebo for tuberculosis, with 107 patients, the outcome was "improved" (binary). The observed ATE was 0.364, indicating a 36.4 percentage-point increase in the probability of improvement due to streptomycin. A
prop.testyielded a p-value less than 0.001, suggesting a statistically significant effect 134 136 137.
22.4 Limitations of RCTs and observational studies
While RCTs are considered the gold standard for causal inference due to their inherent exchangeability, they are not always feasible or ethical 137.
- Observational studies: In these studies, treatment is not randomly assigned, leading to potential systematic differences between treated and untreated individuals before treatment.
- Confounding: This occurs when a variable influences both treatment assignment and the outcome, creating a spurious association. For instance, age might confound the relationship between job-training participation and earnings if younger individuals are more likely to participate and also earn less regardless of participation 137.
| Study Type | Treatment Assignment | Exchangeability | Causal Inference |
|---|---|---|---|
| Randomized Controlled Trial (RCT) | Random | Achieved by design | Direct (correlation = causation) |
| Observational Study | Non-random | Not guaranteed | Challenging (potential confounding) |
23. Measured confounding
23.1 Definition of measured confounding
Measured confounding occurs when a confounder, which is an observed variable, influences both the treatment and the outcome of interest. This creates a non-causal association between the treatment and outcome, making direct comparisons between treated and untreated groups unreliable 139 140.

- Causal DAG: A directed acyclic graph visually represents causal relationships, where arrows indicate the direction of influence.
- Confounder (Xi): A variable that affects both the treatment participation (Zi) and the outcome (Yi) 139.
- Non-exchangeability: Due to confounding, the treated and untreated groups are not comparable, meaning they differ systematically in ways that affect the outcome, beyond the treatment itself 140.
📝 In a study examining the effect of higher education on lifetime income, family income could act as a confounder. Higher family income might increase the likelihood of completing higher education and also directly contribute to higher lifetime income, independent of education 140.
23.2 Simulation example
A simulation can demonstrate how measured confounding leads to biased estimates of treatment effects, even when the true average treatment effect (ATE) is zero 141.
- Simulation setup:
- A sample size (n) of 1000 is generated.
- A confounder (X) is drawn from a uniform distribution between -1 and 1.
- Treatment participation (Z) is a binary variable, influenced by X.
- The outcome (Y) is determined by a constant, X, and random noise, but not directly by Z.
- Observed ATE: The difference in mean outcomes between the treated (Z=1) and untreated (Z=0) groups is calculated.
- Result: Despite the true ATE being 0 in the simulation design, the observed ATE (ATERCT) was 1.051 with a statistically significant p-value (<0.001), indicating a spurious effect due to confounding 141.
24. Assumptions
24.1 Conditional exchangeability (ignorability)
Conditional exchangeability, also known as ignorability, is a fundamental assumption in causal inference for observational studies, positing that treatment assignment is effectively random once all observed confounders are accounted for 143.
- Definition: The treatment assignment Zi is conditionally independent of the potential outcomes (Yi(0),Yi(1)) given the observed covariates Xi.
- Implication: All confounding variables influencing both treatment assignment and outcomes are observed and included in Xi.
- Testability: This assumption is generally untestable in observational studies, requiring substantive knowledge of the data-generating process 143.

📝 If physicians assign a treatment based on patient age and baseline disease severity, conditional exchangeability assumes that, within groups of patients with similar age and disease severity, the treatment assignment is random with respect to their potential outcomes 143.
24.2 Positivity (overlap)
The positivity, or overlap, assumption is crucial for identifying treatment effects, ensuring that for every covariate profile, there is a non-zero probability of receiving any treatment 144.
- Definition: For all x in the support of Xi, the probability of receiving treatment Zi=1 given Xi=x, denoted as the propensity score e(x)=P(Zi=1∣Xi=x), must be strictly between 0 and 1, i.e., e(x)∈(γ,1−γ) for some γ>0.
- Intuition: Both treated and untreated individuals must be present within each relevant covariate group, allowing for meaningful comparisons 144.
24.3 Strong ignorability
Strong ignorability combines conditional exchangeability and positivity, forming a sufficient condition for identifying average treatment effects (ATE) from observed data 145.
- Identification: Under strong ignorability, the expected potential outcomes E[Yi(1)] and E[Yi(0)] can be identified from observed data by integrating conditional expectations over the distribution of covariates 145.
| Assumption | Condition |
|---|---|
| Conditional Exchangeability | Zi⊥⊥(Yi(0),Yi(1))∣Xi |
| Positivity | P(Zi=1∣Xi=x)∈(γ,1−γ) for all x and γ>0 |
25. Regression estimators
25.1 Estimating the average treatment effect with regression
Regression estimators are used to estimate causal effects, specifically the Average Treatment Effect (ATE), under the assumption of strong ignorability. This approach involves estimating the conditional expectation of the outcome given the treatment status and covariates 147.
- Conditional expectation: μ(z,x)=E[Yi∣Zi=z,Xi=x], representing the expected outcome Yi for an individual i with treatment status Zi=z and covariates Xi=x.
- Strong ignorability: A key assumption that allows for the identification of causal effects, implying that treatment assignment is independent of potential outcomes given observed covariates.
- ATE estimation: Under strong ignorability, the ATE, E[Yi(1)−Yi(0)], can be estimated by E[μ(1,Xi)−μ(0,Xi)].
- Consistent estimator: If bμ(z,x) is a consistent estimator of μ(z,x), then the ATE can be consistently estimated by averaging the difference in predicted outcomes across all individuals: ATEREG=n−1∑i=1n{bμ(1,Xi)−bμ(0,Xi)} This regression function bμ(z,x) can be estimated using various methods, including linear regression, generalized linear models, or machine learning techniques 147.

25.2 Linear regression example
When the conditional expectation μ(z,x) is modeled using linear regression, the ATE can be directly estimated by the coefficient of the treatment variable 148.
- Model specification: μ(z,x)=β1+β2z+β3x, where β2 represents the effect of the treatment z.
- OLS estimate: bμ(z,x)=bβ1+bβ2z+bβ3x is the Ordinary Least Squares (OLS) estimate of μ(z,x).
- ATE calculation: Under strong ignorability and correct model specification, the ATEREG simplifies to bβ2, which is a consistent estimator of the ATE and has a causal interpretation 148.
📝 If a linear regression model
lm(Y~Z)is fitted, where Y is the outcome and Z is the treatment, the estimated coefficient for Z (e.g., 1.051 with a p-value <0.001) directly represents the ATE 150.
25.3 Logistic regression example
For binary outcomes, logistic regression is used to model the conditional expectation, and the ATE calculation differs from linear regression 149.
- Binary outcome: Yi is a binary variable.
- Logistic model: μ(z,x)=Λ(β1+β2z+β3x), where Λ(u)=1+exp(u)exp(u) is the logistic function.
- MLE estimate: bμ(z,x)=Λ(bβ1+bβ2z+bβ3x) is the Maximum Likelihood Estimate (MLE) from logistic regression.
- ATE calculation: Unlike linear regression, bβ2 itself is not the ATE. Instead, the ATEREG is calculated by averaging the difference in predicted probabilities: ATEREG=n−1∑i=1n{Λ(bβ1+bβ2+bβ3Xi)−Λ(bβ1+bβ3Xi)} 149.

| Regression Type | Outcome Type | ATE Estimation |
|---|---|---|
| Linear Regression | Continuous | Coefficient of treatment variable (bβ2) |
| Logistic Regression | Binary | Average of predicted probability differences |
📝 When fitting
lm(Y~Z+X)where Y is the outcome, Z is treatment, and X is a covariate, the ATEREG might be approximately 0 with a p-value of 0.458, indicating no significant treatment effect after controlling for X 151.
26. Matching estimators
26.1 Introduction to matching estimators
Matching estimators are a causal inference technique used to estimate treatment effects by pairing treated individuals with similar untreated individuals based on observed covariates. The primary goal is to construct a counterfactual for each treated individual by identifying untreated counterparts that share similar characteristics 153.
- Treated individuals (Zi=1): For each treated individual i, the observed outcome Yi(1) is Yi. The missing potential outcome Yi(0) is estimated by averaging the outcomes of k nearest untreated neighbors.
- Untreated individuals (Zi=0): A similar process is applied to estimate Yi(1) for untreated individuals, using treated neighbors.
- k-nearest neighbors (Mk(i)): This set consists of k untreated individuals (Zj=0) whose covariate values Xj are closest to the treated individual's Xi, minimizing a chosen distance metric ∥Xi−Xj∥. Y^i(0)=k−1∑j∈Mk(i)Yj 153.
26.2 Average treatment effect estimation
Under the assumption of strong ignorability, the average treatment effect (ATE) can be estimated by averaging the difference between the estimated potential outcomes for all individuals. This approach aims to balance covariates between treatment and control groups, thereby reducing confounding. ATEMATCH=n−1∑i=1n(Y^i(1)−Y^i(0)) 154.
26.3 Bias-variance trade-off in matching
The selection of the number of matches (k) involves a critical bias-variance trade-off, a fundamental concept in statistical learning. This choice impacts the quality of the matches and the stability of the ATE estimate 154.
| Number of matches (k) | Effect on matches | Effect on variability |
|---|---|---|
| Small k | Closer matches | More variability |
| Large k | Less similar matches | Less variability |
26.4 Choice of distance metrics
The selection of a distance metric is crucial for accurately identifying similar individuals. Different metrics quantify similarity in distinct ways, influencing the composition of the k-nearest neighbors 154.
| Distance metric | Formula | Description |
|---|---|---|
| Euclidean distance | ∑ℓ=1p(Xiℓ−Xjℓ)2 | Standard straight-line distance; requires covariate standardization. |
| Mahalanobis distance | (Xi−Xj)⊤SX−1(Xi−Xj) | Accounts for correlations between covariates and scales them by their variance; SX is the estimated covariance matrix of covariates. |
📝 In a simulation using the
Matchinglibrary, an ATE was estimated with k=1 nearest neighbor and Mahalanobis distance. TheMatchfunction was called withY(outcome),Tr(treatment indicator),X(covariates),estimand = "ATE",M = 1, andWeight = 2(for Mahalanobis distance). The resulting ATEMATCH was approximately 0, with a p-value of 0.509, suggesting no significant treatment effect in this specific simulation 155.
27. Propensity score estimators
27.1 Propensity score and conditional exchangeability
Propensity score estimators leverage the probability of treatment assignment conditional on covariates, e(Xi)=P(Zi=1∣Xi), to achieve conditional exchangeability. Under this condition, treatment assignment Zi is independent of potential outcomes (Yi(0),Yi(1)) given the propensity score e(Xi) 157.
- Strong ignorability: This condition allows for identification of the Average Treatment Effect (ATE) by conditioning on the scalar propensity score e(Xi) instead of the full set of covariates Xi.
- Application in estimators: Propensity scores can be used in matching estimators by pairing individuals based on the absolute difference in their propensity scores, ∣e(Xi)−e(Xj)∣. They can also be incorporated into regression estimators, though a simple linear regression on the propensity score may be misspecified 157.
27.2 Inverse Probability Weighting (IPW) for ATE
Under positivity and conditional exchangeability, the Average Treatment Effect (ATE) can be identified using inverse probability weighting. This method reweights observations to account for confounding by balancing covariates between treatment groups 158.
- Identification of E[Yi(1)]: The expected value of the outcome under treatment, E[Yi(1)], can be expressed as E[e(Xi)ZiYi].
- ATE formula: The ATE is identified as the difference between the reweighted expected outcomes for the treated and control groups: ATE=E[e(Xi)ZiYi−1−e(Xi)(1−Zi)Yi] 158.
📝 The ATE is identified as E[e(Xi)ZiYi−1−e(Xi)(1−Zi)Yi] 158.
27.3 Horvitz-Thompson and Hájek estimators
When a consistent estimator e^(Xi) of the propensity score is available, the ATE can be consistently estimated using IPW estimators. These estimators differ in how they normalize the weights 159.
| Estimator | Formula |
|---|---|
| Horvitz-Thompson estimator | ATEIPW=n−1∑i=1n[e^(Xi)1(Zi=1)Yi−1−e^(Xi)1(Zi=0)Yi] |
| Hájek estimator | ATEIPW∗=∑i=1ne^(Xi)1(Zi=1)∑i=1ne^(Xi)1(Zi=1)Yi−∑i=1n1−e^(Xi)1(Zi=0)∑i=1n1−e^(Xi)1(Zi=0)Yi |
- Stability: The Hájek estimator, which normalizes the weights, is often more stable than the Horvitz-Thompson estimator 159.
27.4 Propensity score estimation methods
The propensity score e(Xi) can be estimated using various statistical models, with logistic regression being a common choice 160.
- Logistic regression: This method models the probability of treatment assignment as a function of covariates using a logit link function.
The formula e^(Xi)=1+exp{Xi⊤β^}exp{Xi⊤β^} provides the estimated propensity score. - Alternative methods: Other methods like probit regression and more flexible machine learning techniques can also be employed for propensity score estimation.
- Efficiency improvement: A counterintuitive finding is that estimating the propensity score can enhance the efficiency of IPW estimators, even when the true propensity score is known. Using an estimated propensity score, e^, can lead to a smaller asymptotic variance compared to using the true propensity score, e 160.
27.5 Simulation example
A simulation demonstrates the application of the Hájek estimator and the impact of using an estimated versus true propensity score on estimator efficiency 161.
- Hájek estimator with logistic model: Using the
PSweightpackage in R, a Hájek estimator with a logistic model for the propensity score can be fitted. In a simulated example where the true ATE is 0, the estimator yields a result close to 0 with a non-significant p-value 161.
- Impact of true propensity score: When the true propensity score is used instead of an estimated one, the standard error of the ATE estimate increases, and the confidence interval becomes significantly wider (e.g., 66% wider in the simulation). This illustrates the efficiency gain from estimating the propensity score 162.
28. The JTPA data set
28.1 The National Job Training Partnership Act (JTPA) Study
The National Job Training Partnership Act (JTPA) Study was conducted between 1987 and 1989 to evaluate the effectiveness of over 600 federally funded job-training programs in the United States. These programs offered services such as classroom training, on-the-job training, and job search assistance 164.
- Study participants: Over 20,000 eligible adults and out-of-school youths were enrolled, with follow-up data collected on employment, earnings, and program participation 164.
- Random assignment: Participants were initially randomly assigned to either a treatment group (eligible for JTPA services) or a control group (not eligible for 18 months).
- Noncompliance: Approximately 3% of the control group members accessed JTPA services despite their assignment, indicating potential noncompliance with randomization guidelines.
- Confounding: Noncompliance can lead to confounding if individuals self-select into programs, potentially biasing the assessment of JTPA participation.
- Sample restriction: The dataset used for analysis is restricted to 9,223 individuals aged 22 or older 165.
28.2 Observed variables in the JTPA dataset
The jtpa.csv dataset includes several observed variables crucial for assessing the causal effect of job training programs on earnings 166.
| Variable | Description |
|---|---|
| earnings | Total earnings (in USD) in the 30 months following random assignment |
| sex | 1 if male, 0 if female |
| edu | Years of completed education |
| prevearn | Total earnings (in USD) during the 12 months before random assignment |
| Z | 1 if participation in job training program, 0 if no participation |
| W | 1 if assigned to treatment group, 0 if assigned to control group |
- Research interest: The primary objective is to determine the causal effect of the job training program on participants' earnings 166.
28.3 Causal inference estimators and their results
Various causal inference estimators were applied to the JTPA dataset to estimate the average treatment effect (ATE) of the job training program on earnings. These methods include regression, matching, and inverse probability weighting 167 168 169.
- Regression estimator (ATE_REG): A linear model
lm(earnings~sex+edu+prevearn+Z, data=jtpadata)yielded an ATE_REG of 2796.9 USD with a p-value < 0.001 167. - Matching estimator (ATE_MATCH): Using
MatchwithY = jtpadata$earnings,Tr = jtpadata$Z, andX = cbind(jtpadata$sex, jtpadata$edu, jtpadata$prevearn), an ATE_MATCH of 2719.4 USD was obtained with a p-value < 0.001 168. - Inverse Probability Weighting (ATE_IPW): The
PSweightfunction withps.formula = Z ~ sex+edu+prevearnandyname = "earnings"resulted in an ATE_IPW of 2813.7 USD with a p-value < 0.001 169. - Naive estimator (ATE_RCT): A simple linear model
lm(earnings~Z, data=jtpadata)that ignores measured confounding produced an ATE_RCT of 2690.4 USD with a p-value < 0.001. - Bias observation: Ignoring measured confounding variables tends to underestimate the true treatment effect 170.
28.4 Assumptions and limitations of estimators
Each causal inference estimator relies on specific assumptions and has inherent sensitivities, influencing its suitability for a given dataset 171.
| Estimator Type | Advantages | Disadvantages |
|---|---|---|
| Regression | No need to estimate e(Xi) | Sensitive to errors in estimating μ(Zi,Xi) |
| Matching | No need to estimate μ(Zi,Xi) or e(Xi) | Sensitive to metric choice and may perform poorly with many covariates |
| Inverse Probability Weighting | No need to estimate μ(Zi,Xi) | Sensitive to errors in estimating e(Xi) and potentially unstable when propensity scores are close to 0 or 1 |
- Estimator choice: The selection of an appropriate estimator depends critically on the modeling assumptions and design choices the researcher is willing to make 171.
28.5 Strong ignorability and unobserved confounding
The assumption of strong ignorability is fundamental to many causal inference methods, implying that all confounding variables are observed and accounted for 172.
- Plausibility for JTPA: The plausibility of strong ignorability for the JTPA dataset is questionable.
- Unobserved motivation example: If individuals with higher unobserved motivation are more likely to participate in job training and would also earn more independently of the training, then the observed earnings difference may be attributed to motivation rather than the program itself.
- Conditional exchangeability: Such a scenario violates conditional exchangeability, leading to biased estimates from estimators that rely on this assumption 172.
📝 Consider a situation where participants in a job training program show higher post-training earnings. If these participants also possessed a higher intrinsic motivation for career advancement that was not measured, then the observed earnings increase might be partly due to this unobserved motivation rather than solely the training program. This unobserved factor (motivation) confounds the relationship between training and earnings, making it difficult to isolate the true causal effect of the training.
29. Unmeasured confounding
29.1 Unmeasured confounding and conditional exchangeability
Unmeasured confounding occurs when an unobserved common cause, Ui, influences both the treatment assignment, Zi, and the outcome, Yi, even after conditioning on all observed covariates, Xi. This scenario violates the assumption of conditional exchangeability, which posits that Zi⊥⊥(Yi(0),Yi(1))∣Xi.
When this assumption fails, the treatment is considered endogenous, meaning its assignment is correlated with unobserved factors that also affect the outcome, leading to biased causal effect estimates 174.
29.2 Instrumental variables (IV)
An instrumental variable (IV), denoted as Wi, is a method to address unmeasured confounding by exploiting exogenous variation in the treatment. The core idea is to utilize the variation in Zi that is induced by Wi to estimate the causal effect of Zi on Yi, ensuring this variation is unrelated to the unobserved confounder Ui 175.
📝 In a study examining the effect of a new medication (Zi) on patient recovery (Yi), unmeasured patient health status (Ui) might influence both medication adherence and recovery. A patient's geographic proximity to a specialized clinic (Wi) could serve as an instrumental variable if it affects the likelihood of receiving the medication but does not directly influence recovery or correlate with unmeasured health status.

30. Instrumental variables
30.1 Introduction to instrumental variables
Instrumental variables (IV) address confounding by unobserved factors when estimating causal effects, particularly when individuals self-select into treatments based on unmeasured characteristics. The IV approach isolates a source of treatment variation that is effectively random, allowing for a more robust comparison of outcomes 176.
30.2 Conditions for a valid instrument
A valid instrument is a variable that satisfies three critical conditions, which collectively enable the estimation of causal effects in the presence of unmeasured confounding 178.
| Condition | Description |
|---|---|
| Instrument exogeneity | The instrument is independent of unmeasured causes of the outcome (Ui⊥⊥Wi). |
| Exclusion restriction | The instrument affects the outcome only through the treatment and has no direct effect on the outcome (Wi→Yi). |
| Relevance | The instrument has a direct effect on the treatment (Wi→Zi). |
The exclusion restriction and instrument exogeneity conditions generally cannot be empirically tested from observed data because they pertain to unobserved relationships 178.
30.3 Instrumental variables in JTPA data
In the Job Training Partnership Act (JTPA) dataset, treatment assignment (W) serves as a potential instrument for treatment participation (Z) to estimate its effect on earnings (Y).
- Treatment assignment: W=1 for the treatment group, W=0 for the control group.
- Instrument exogeneity: This condition is met by design due to the randomized assignment to treatment and control groups, similar to exchangeability in a Randomized Controlled Trial (RCT).
- Exclusion restriction: This is assumed to hold, as it is plausible that treatment assignment influences earnings solely through actual treatment participation.
- Relevance: If this condition is satisfied, treatment assignment is considered a valid instrument for treatment participation 179.
30.4 Testing the relevance condition
The relevance condition can be empirically tested using observed data, typically through a first-stage F-test 180.
- First-stage regression: This regression models the relationship between the treatment (Zi) and the instrument (Wi), controlling for exogenous covariates (Xi). The equation is: Zi=Xi⊤η+λWi+vi where Xi includes an intercept and exogenous covariates, and parameters are estimated using Ordinary Least Squares (OLS).
- F-test for relevance: The null hypothesis H0:λ=0 is tested. A common rule of thumb suggests that an F-statistic greater than 10 provides strong evidence for the relevance condition.
- Relationship between F and t-statistic: The F-statistic is equal to the square of the t-statistic (F=t2) 180.
📝 In the JTPA data, a first-stage regression of
ZonW,sex,edu, andprevearnyields a t-value forWof 73.7922. Squaring this gives an F-statistic of 5445.259, which is significantly greater than 10, indicating strong evidence for the relevance condition. However, it is important to note that first-stage errors are often heteroscedastic. When robust standard errors are used, the t-value forWbecomes 99.47942, resulting in an F-statistic of 9896.151, further confirming the satisfaction of the relevance condition 181 182.![]()
30.5 Formal definition of IV conditions
Let Yi(w,z) represent the potential outcome for individual i if Wi=w and Zi=z. The IV conditions can be formally defined as follows 183:
- Relevance: P(Zi=1∣Wi=1)=P(Zi=1∣Wi=0). This means the instrument must influence the probability of receiving the treatment.
- Exclusion restriction: Yi(w,z)=Yi(z) for all (w,z)∈{0,1}2. This implies that the instrument affects the outcome only through its effect on the treatment.
- Instrument exogeneity: (Yi(0,0),Yi(1,0),Yi(0,1),Yi(1,1))⊥⊥Wi. This means the instrument is independent of all potential outcomes 183.
These assumptions can also be made conditional on measured exogenous covariates Xi 183.
30.6 Challenges in finding valid instruments
Identifying a valid instrumental variable can be challenging in empirical research due to the stringent conditions required 184.
📝 Examples of commonly used instruments include draft lottery eligibility for military service, season of birth for educational attainment, distance to university for years of education, and year of medical treatment for receiving a specific treatment 184.
31. Effect homogeneity
31.1 Identifying the average treatment effect
Identifying the Average Treatment Effect (ATE) under unmeasured confounding generally requires additional assumptions beyond the standard instrumental variable (IV) conditions. Different assumptions lead to the identification of distinct treatment effects 185.
| Assumption | Identified Treatment Effect |
|---|---|
| Effect homogeneity | Average Treatment Effect (ATE) |
| Monotonicity | Local Average Treatment Effect (LATE) |
31.2 Effect homogeneity and the Wald ratio
Effect homogeneity, in its strongest form, posits that the effect of an instrument Zi on an outcome Yi is constant across all individuals, expressed as Yi(1)−Yi(0)=α for all i∈{1,…,n}, where α∈R. Under the IV conditions and effect homogeneity, without exogenous covariates Xi, the ATE can be identified using the Wald ratio 187.
The Wald ratio is defined as: ATE=E[Zi∣Wi=1]−E[Zi∣Wi=0]E[Yi∣Wi=1]−E[Yi∣Wi=0] This ratio represents the effect of the instrument on the outcome relative to its effect on the treatment. In an ideal Randomized Controlled Trial (RCT) where Wi=Zi, the Wald ratio simplifies to E[Yi∣Zi=1]−E[Yi∣Zi=0] 187 188.
📝 If an instrument Wi (e.g., encouragement to participate in a program) increases participation Zi by 10% and increases the outcome Yi (e.g., earnings) by 500 USD, the ATE would be 500/0.10=5000 USD, assuming effect homogeneity.
The ATE can be estimated using the sample-based Wald estimator: ATEWALD=ZˉW=1−ZˉW=0YˉW=1−YˉW=0 where YˉW=w and ZˉW=w are the sample means of Yi and Zi for individuals with Wi=w 188.
31.3 Two-Stage Least Squares (2SLS)
When exogenous covariates Xi are present, Two-Stage Least Squares (2SLS) is commonly employed to estimate the ATE. 2SLS involves two sequential Ordinary Least Squares (OLS) regressions:
- First-stage regression: Zi=Xi⊤η+λWi+vi. This stage estimates the effect of the instrument Wi on the treatment Zi, controlling for covariates Xi. The estimated Zi is then used in the second stage.
- Second-stage regression: Yi=Xi⊤β+αZi+ϵi. This stage estimates the effect of the predicted treatment Zi on the outcome Yi, where α represents the ATE under IV conditions and effect homogeneity 189.
2SLS effectively isolates the variation in treatment Zi that is solely attributable to the instrument Wi, given Xi, and uses this variation to estimate the treatment effect. It is important to note that the first stage serves as a linear projection, and the fact that Zi may fall outside the [0,1] range does not invalidate the method.
While coefficient estimates are obtained via OLS, statistical inference requires appropriate standard error correction 190.
If no exogenous covariates Xi are included, the 2SLS estimator is equivalent to the Wald estimator:
α2SLS=ATEWALD This equivalence highlights that both methods aim to identify the ATE under similar assumptions, with 2SLS extending to incorporate covariates 190.
📝 In a study on job training, if 2SLS estimates an ATE of 850 USD less than an estimate under strong ignorability, this difference, under treatment-effect homogeneity and valid IV assumptions, suggests positive selection into job training. This could mean more motivated individuals are more likely to enroll and earn more even without training 192.
31.4 Wu–Hausman test and control-function approach
The Wu–Hausman test is used to assess whether the treatment variable Zi is endogenous, with the null hypothesis (H0) stating that Zi is exogenous. Rejecting H0 provides evidence of endogeneity, but failing to reject H0 does not confirm exogeneity 192.
The control-function (CF) approach offers an alternative method for handling endogeneity in linear models. It involves:
- Computing the residuals vi=Zi−Xi⊤η−λWi from the first-stage regression.
- Estimating an augmented structural equation: Yi=Xi⊤β+αZi+ρvi+ϵi using OLS 193.
In this approach, vi captures the potentially endogenous component of Zi. In linear models, the coefficient αCF from the control-function approach is identical to α2SLS from 2SLS.
The Wu-Hausman test can also be formulated as testing H0:ρ=0 in the augmented structural equation 193.
32. Monotonicity
32.1 Monotonicity assumption and latent subgroups
The monotonicity assumption is a critical condition in causal inference that allows for heterogeneous treatment effects while restricting how an instrumental variable (IV) influences treatment selection. It posits that individuals do not take the opposite treatment than assigned, effectively ruling out "defiers" 195 196.
- Potential treatment status Zi(w): This refers to the treatment an individual i would receive if the instrumental variable Wi were set to w 195.
- Monotonicity assumption: Formally stated as P(Zi(0)>Zi(1))=0, this implies that no individual would receive treatment when assigned to the control group (Wi=0) but not receive treatment when assigned to the treatment group (Wi=1).
- One-sided noncompliance: If individuals in the control group cannot access the treatment, monotonicity is inherently satisfied 196.
| Subgroup | Definition |
|---|---|
| Compliers | Zi(1)=1 and Zi(0)=0 |
| Always-takers | Zi(1)=1 and Zi(0)=1 |
| Defiers | Zi(1)=0 and Zi(0)=1 |
| Never-takers | Zi(1)=0 and Zi(0)=0 |
📝 In a study evaluating a new drug, a complier is someone who takes the drug if prescribed and does not take it if not prescribed. A defier would be someone who refuses the drug if prescribed but somehow obtains and takes it if not prescribed, which monotonicity rules out.
32.2 Extended instrumental variable conditions
The extended IV conditions are a set of assumptions necessary for identifying causal effects, particularly when combined with monotonicity. These conditions build upon standard IV assumptions by extending exogeneity to potential treatment statuses 197.
- Extended instrument exogeneity: This condition states that (Yi(0,0),Yi(1,0),Yi(0,1),Yi(1,1),Zi(1),Zi(0))⊥⊥Wi.
- It implies that the proportions of compliers, always-takers, never-takers, and defiers are consistent across both treatment and control groups.
- This ensures that the treatment assignment is not disproportionately allocated to individuals who would inherently follow the treatment.
- Components: The extended IV conditions comprise the relevance condition, the exclusion restriction, and the extended instrument exogeneity condition 197.
32.3 Local average treatment effect (LATE)
Under the extended IV conditions and the monotonicity assumption, the Local Average Treatment Effect (LATE) is identified. LATE represents the average treatment effect specifically for the subpopulation of compliers 198.
- LATE formula: LATE=E[Yi(1)−Yi(0)∣Zi(1)>Zi(0)].
- This measures the average difference in potential outcomes for individuals who would comply with their assigned treatment status.
- Complier proportion: The proportion of compliers is identifiable and is equivalent to the denominator of the Wald ratio: P(Zi(1)>Zi(0))=E[Zi∣Wi=1]−E[Zi∣Wi=0] 198.
- Wald ratio and 2SLS: Under these conditions, the Wald ratio and the Two-Stage Least Squares (2SLS) estimator identify the LATE, providing a causal interpretation for the complier subgroup 199.
📝 In the JTPA study on job training services, the LATE was estimated to be 1946.09 USD, meaning that for the 64% of individuals who were compliers, the average treatment effect on earnings was approximately 1946.09 USD 199.
32.4 Average treatment effect for the treated (ATT)
When the extended IV conditions are met, and there is one-sided noncompliance, the monotonicity assumption is automatically satisfied, and always-takers are also ruled out. In this specific scenario, all treated individuals are considered compliers, and the Average Treatment Effect for the Treated (ATT) is identified 200.
- ATT formula: ATT=E[Yi(1)−Yi(0)∣Zi=1].
- This answers the question of how beneficial the treatment is for those who actually receive it.
- Relationship with LATE: Under extended IV conditions and one-sided noncompliance, ATT is equal to LATE 200.

32.5 Causal effects under different assumptions
The specific causal effect identified by methods like the Wald ratio or 2SLS depends on the additional assumptions imposed alongside the extended IV conditions 201.
| Assumption | Identified Causal Effect |
|---|---|
| Effect homogeneity | Average Treatment Effect (ATE) |
| Monotonicity | Local Average Treatment Effect (LATE) |
| One-sided noncompliance | Average Treatment Effect for the Treated (ATT) |
33. Alternative approaches
33.1 Alternative approaches to instrumental variables
Beyond instrumental variables, several alternative methodologies exist for causal inference, each offering distinct advantages in specific research contexts. These approaches provide robust frameworks for estimating treatment effects under varying assumptions 202.
| Approach | Description |
|---|---|
| Regression discontinuity design | Treatment assignment changes deterministically at a known threshold of an observed variable, allowing for comparison of individuals near the cutoff to approximate a randomized experiment. |
| Partial identification | Instead of strong identifiability assumptions, these methods aim to bound treatment effects, providing a range rather than a point estimate. |
📝 In an educational intervention, if a scholarship is awarded to students with a GPA above 3.0, a regression discontinuity design would compare students with GPAs just above 3.0 to those just below 3.0 to estimate the scholarship's causal effect on future academic performance 202.
33.2 Transition to longitudinal data
The subsequent focus in causal inference shifts to analyzing data where the same individuals are observed across multiple time periods. This type of data is commonly referred to as longitudinal data or panel data 202.
© 2026 Maeve. All rights reserved. This content is protected by copyright.

