StatBCS 7Regression 4 handout without solutions

Multiple linear regression (MLR)

Multiple Linear Regression (MLR) is a statistical method that extends simple linear regression by allowing for multiple independent variables to predict a single dependent variable. This technique is widely applicable, including in cognitive neuroscience, for instance, in Statistical Parameter Mapping (SPM) which is used to analyze neuroimaging data like fMRI 5.

The core concept of MLR can be represented by the following model: Y=α+β1X1+β2X2+⋯+βpXp+ϵY = \alpha + \beta_1X_1 + \beta_2X_2 + \dots + \beta_pX_p + \epsilon where:

  • YY is the dependent variable.
  • X1,X2,…,XpX_1, X_2, \dots, X_p are the pp independent variables (predictors).
  • α\alpha is the intercept, representing the expected value of YY when all independent variables are zero.
  • β1,β2,…,βp\beta_1, \beta_2, \dots, \beta_p are the regression coefficients, each indicating the change in YY for a one-unit increase in the corresponding XjX_j, holding all other predictors constant.
  • ϵ\epsilon is the error term, representing the unexplained variance.

In matrix notation, this model is expressed as: y=Xβ+ey = X\beta + e where yy is a vector of observed dependent variable values, XX is the design matrix containing the independent variables (including a column of ones for the intercept), β\beta is a vector of coefficients, and ee is a vector of residuals 7 8.

Design matrix in fMRI

In the context of fMRI analysis, the design matrix is crucial. It typically includes regressors representing the experimental paradigm (e.g., task timing, stimulus presentation), nuisance regressors to account for confounding factors (e.g., head motion parameters, physiological noise), and terms for session constants and drifts (e.g., intercept, polynomial drifts). Temporal derivatives of predictors are often included to account for temporal jitter in the experimental design 5 6.

Example: A design matrix might include columns for a main task, a constant (intercept), and the temporal derivative of the main task to capture potential timing variations 6.

Geometric interpretation

Similar to how simple linear regression represents a line in a 2-dimensional space (R2R^2), MLR with two independent variables can be visualized as a plane in a 3-dimensional space (R3R^3). For a model with pp predictors, the relationship can be envisioned in p+1p+1 dimensions 7.

Interpretation of coefficients

  • Intercept (α\alpha): This is the conditional expected value of the dependent variable (YY) when all independent variables (XjX_j) are zero. α=E(Y∣X=0)\alpha = E(Y|X = 0).
  • Partial Regression Coefficients (βj\beta_j): Each βj\beta_j represents the change in the expected value of YY when XjX_j increases by one unit, while all other independent variables (Xj′≠jX_{j'\neq j}) are held constant. This is also known as the partial effect 9.

Example: If β1=−0.05\beta_1 = -0.05 for the Prefrontal Cortex Volume (X1X_1) predicting Stroop Interference Score (YY), it means that for every 1 cubic millimeter increase in Prefrontal Cortex Volume, the Stroop Interference Score is expected to decrease by 0.05 milliseconds, assuming all other predictors remain unchanged 9.

Ordinary Least Squares (OLS) solution

The goal of OLS is to find the coefficients (β^\hat{\beta}) that minimize the sum of squared residuals (SSResSS_{Res}). This is achieved by satisfying two conditions:

  1. The sum of residuals is zero: ∑i=1nei=0\sum_{i=1}^{n} e_i = 0. This ensures the regression hyperplane passes through the mean of all variables. The estimated intercept is then calculated as α^=yˉ−∑j=1pβ^jxˉj\hat{\alpha} = \bar{y} - \sum_{j=1}^{p} \hat{\beta}_j\bar{x}_j.
  2. The covariance between each independent variable (xjx_j) and the residuals (ee) is zero: sxj,e=0s_{x_j,e} = 0 for all j∈{1,…,p}j \in \{1, \dots, p\}. This can be summarized by the matrix equation XTe=0X^T e = 0 10.

The OLS solution for the coefficient vector β^\hat{\beta} is given by the formula: β^=(XTX)−1XTy\hat{\beta} = (X^TX)^{-1}X^Ty This solution involves the inverse of the (XTX)(X^TX) matrix, which contains information about the means and covariances of the independent variables, and the (XTy)(X^Ty) vector, which contains the sum of the dependent variable and its covariances with the independent variables 11.

Test of the regression coefficients

The OLS estimators (β^\hat{\beta}) are considered Best Linear Unbiased Estimators (BLUE), meaning they have the smallest variance among all linear unbiased estimators 12.

  • Expected value: E(β^)=βE(\hat{\beta}) = \beta
  • Variance: Var(β^)=σ2(XTX)−1Var(\hat{\beta}) = \sigma^2(X^TX)^{-1}

The variance of a specific coefficient β^j\hat{\beta}_j can be expressed as: Var(β^j)=SE(β^j)2=σ2nsxj2(1−Rj2)Var(\hat{\beta}_j) = SE(\hat{\beta}_j)^2 = \frac{\sigma^2}{n s_{x_j}^2 (1 - R_j^2)} where sxj2s_{x_j}^2 is the sample variance of the predictor XjX_j, and Rj2R_j^2 is the R-squared value obtained from regressing XjX_j on all other predictors 12.

Since the true error variance σ2\sigma^2 is usually unknown, it is estimated by the Mean Squared Error (MSResMS_{Res}). This allows for testing individual regression coefficients (β^j\hat{\beta}_j) using a t-test, similar to simple linear regression 12.

Derivations for p=2

The OLS solution for a model with two predictors (p=2p=2) can be derived explicitly, leading to expressions for the coefficients in terms of simple and partial correlations. The partial regression coefficients can be rewritten using partial correlations, which "clean" the relationship between the dependent variable and one independent variable by accounting for the contribution of the other variables 13 14.

Multicollinearity and Singularity

Multicollinearity occurs when independent variables in a regression model are highly correlated with each other. Singularity is an extreme case where one or more independent variables are perfectly linearly related to others 15.

Problems caused by multicollinearity

  • Inestimable Coefficients: If two predictors are identical (X1=X2X_1 = X_2), the model effectively becomes a simple linear regression, and it's impossible to distinguish the individual contributions of β1\beta_1 and β2\beta_2 to the combined effect 15.
  • Singular Matrix: If independent variables are linear combinations of each other, the XTXX^TX matrix becomes singular (determinant is zero) and cannot be inverted, meaning no OLS solution exists.
  • Inflated Standard Errors: Even if the determinant is not exactly zero but small, the inverse (XTX)−1(X^TX)^{-1} can have large values, leading to inflated variances and standard errors for the coefficient estimates.
  • Reduced Power: Inflated standard errors lead to deflated t-statistics, potentially resulting in Type II errors (false non-significance), reduced statistical power, and unreliable model predictions 16.

Detecting multicollinearity

Methods for detecting multicollinearity include: a) Scatterplots of pairs of independent variables. b) Calculating the determinant of the XTXX^TX matrix (singularity if Det(XTXX^TX) = 0). c) Eigenvalue methods (less commonly discussed in introductory contexts). d) Calculating the Variance Inflation Factor (VIF) for each predictor 17.

The variance of the estimators is influenced by several factors: larger noise (σ2\sigma^2) increases SEs, larger sample size (nn) and variance of the predictor (sxj2s_{x_j}^2) decrease SEs, and a smaller Rj2R_j^2 (less prediction of XjX_j by other predictors) improves the SE. The term 11−Rj2\frac{1}{1 - R_j^2} highlights the negative impact of high Rj2R_j^2 values 17 18.

Variance Inflation Factor (VIF)

The VIF for the jj-th independent variable quantifies how much the variance of the estimated regression coefficient is inflated due to collinearity with other predictors. VIFj=11−Rj2VIF_j = \frac{1}{1 - R_j^2} where Rj2R_j^2 is the R-squared from regressing XjX_j on all other predictors 19.

Rules of thumb for VIF:

  • VIFj=1VIF_j = 1: No collinearity.
  • 1<VIFj<51 < VIF_j < 5: Moderate collinearity.
  • VIFj≥5VIF_j \geq 5: Strong collinearity.
  • VIFj≥10VIF_j \geq 10: Serious problem 19.

Remedies for multicollinearity: a) Remove the predictor causing high VIF if it's not theoretically essential. b) Identify and address outliers or influential points. c) Consider standardizing variables or removing the intercept (though standardizing is generally preferred) 19.

ANOVA Table for MLR

The Analysis of Variance (ANOVA) table in MLR partitions the total variation in the dependent variable (YY) into components explained by the regression model and the residual error 20.

Source of VariationDegrees of Freedom (dfdf)Sum of Squares (SSSS)Mean Square (MSMS)FF statistic
RegressionppSSReg=∑(y^i−yˉ)2SS_{Reg} = \sum (\hat{y}_i - \bar{y})^2MSReg=SSReg/pMS_{Reg} = SS_{Reg} / pF=MSReg/MSResF = MS_{Reg} / MS_{Res}
Residual Errorn−p−1n - p - 1SSRes=∑(yi−y^i)2SS_{Res} = \sum (y_i - \hat{y}_i)^2MSRes=SSRes/(n−p−1)MS_{Res} = SS_{Res} / (n - p - 1)—
Totaln−1n - 1SSTot=∑(yi−yˉ)2SS_{Tot} = \sum (y_i - \bar{y})^2——

Key points:

  1. For estimation and testing, it must hold that n>p+1n > p + 1.
  2. The overall FF-test (General Linear F-Test) assesses whether at least one of the regression coefficients is significantly different from zero.
  3. R2R^2, the coefficient of multiple determination, represents the proportion of variance in the dependent variable explained by the model. A partial R2R^2 indicates the proportion of variance explained by a subset of predictors. The square root of R2R^2 (R2\sqrt{R^2}) is the coefficient of multiple correlation, which is the correlation between YY and Y^\hat{Y} (ryy^r_{y\hat{y}}) 20.

General Linear F-Test

The General Linear F-Test is used to test hypotheses about subsets of regression coefficients. It involves comparing a "Full" (unrestricted) model with a "Reduced" (restricted) model.

  1. Estimate OLS coefficients and SSResSS_{Res} for both models:
  • Full model (FF): Includes all predictors of interest. SSRes,FSS_{Res,F}.
  • Reduced model (RR): A subset of the predictors from the full model. SSRes,RSS_{Res,R}.
  1. Calculate the sequential (extra) sum of squares: SSRes,R−SSRes,FSS_{Res,R} - SS_{Res,F}. This represents the reduction in unexplained variance (or increase in explained variance) gained by adding the predictors from the full model that are not in the reduced model.
  2. The FF-statistic is computed as: F=(SSRes,R−SSRes,F)/(dfR−dfF)SSRes,F/dfFF = \frac{(SS_{Res,R} - SS_{Res,F}) / (df_R - df_F)}{SS_{Res,F} / df_F} This test determines if the additional predictors in the full model significantly improve the model fit compared to the reduced model 21.

The sequential sum of squares can also be used to calculate the Partial R2R^2: Ry,B∣A2=SSRes,A−SSRes,A∪BSSRes,A=SSRes,B∣ASSRes,AR^2_{y,B|A} = \frac{SS_{Res,A} - SS_{Res,A \cup B}}{SS_{Res,A}} = \frac{SS_{Res,B|A}}{SS_{Res,A}} This value represents the proportion of variance explained by adding a set of predictors BB to a model already containing predictors AA 22.

Advanced: alternative approaches to OLS

While Ordinary Least Squares (OLS) is the standard method, Weighted Least Squares (WLS) and Generalized Least Squares (GLS) are used when assumptions about the error term's variance-covariance matrix are violated 23.

  • OLS assumptions: Assumes the error variance-covariance matrix (ΘOLS\Theta_{OLS}) is σ2I\sigma^2I, meaning errors are independent and have constant variance.
  • WLS assumptions: Assumes the error variance-covariance matrix (ΘWLS\Theta_{WLS}) is a diagonal matrix with potentially different variances for each observation (σi2\sigma^2_i).
  • GLS assumptions: Assumes a general error variance-covariance matrix (ΘGLS\Theta_{GLS}) where errors can be correlated and have unequal variances.

The OLS solution is a special case of the WLS/GLS solution where W=Θ−1W = \Theta^{-1} is the inverse of the error variance-covariance matrix. For OLS, W=1σ2IW = \frac{1}{\sigma^2}I, which simplifies the solution to the standard formula 23.

Limitations of MLR and extensions

MLR has several limitations that lead to more advanced models:

  1. Single Dependent Variable: MLR can only handle one dependent variable at a time. Multivariate Regression extends this to multiple correlated dependent variables.
  2. Direct Effects Only: MLR models direct effects from IVs to the DV. Path Analysis can model simultaneous regressions and direct/indirect effects between multiple IVs and DVs.
  3. Fixed Effects: MLR models only fixed effects. Mixed-Effects Models incorporate both fixed and random effects, essential for hierarchical or longitudinal data.
  4. Continuous Dependent Variable: MLR assumes a continuous DV. Generalized Linear Models (GLMs) can handle categorical or other types of DVs.
  5. Observed Variables: MLR uses observed variables. Latent Variable Models (e.g., Factor Analysis, Structural Equation Models) allow for unobserved (latent) IVs and DVs 25.

Multivariate Regression

Multivariate Regression extends MLR to scenarios with multiple dependent variables (dd) and multiple independent variables (pp). The model can be written for each dependent variable 26: Yk=αk+βk1X1+βk2X2+⋯+βkpXp+ϵkY_k = \alpha_k + \beta_{k1}X_1 + \beta_{k2}X_2 + \dots + \beta_{kp}X_p + \epsilon_k for k=1,…,dk = 1, \dots, d.

In matrix notation, the system of regressions becomes: Y=XB+EY = XB + E where YY is a n×dn \times d matrix of dependent variables, XX is the n×(p+1)n \times (p+1) design matrix (including the intercept column), BB is a (p+1)×d(p+1) \times d matrix of regression coefficients, and EE is a n×dn \times d matrix of residuals 27.

Estimation in Multivariate Regression

The least squares estimator for the coefficient matrix BB is found by minimizing the sum of squared residuals across all dependent variables. This leads to: B^=(XTX)−1XTY\hat{B} = (X^TX)^{-1}X^TY This formula is analogous to the MLR solution, effectively stacking multiple MLR problems 29.

Related Models

  • Multivariate ANOVA (MANOVA): Occurs when all predictors are categorical.
  • Multivariate ANCOVA (MANCOVA): Occurs when predictors include both categorical and continuous variables.
  • Repeated Measures Analysis: Multivariate approaches can analyze correlated errors in repeated measures data, although "univariate" approaches are often more common 29.

Why multivariate regression is less common

  1. Complexity: Univariate approaches are generally simpler to implement and interpret.
  2. Test Statistics: Multivariate analyses involve multiple complex test statistics (e.g., Wilk's Lambda, Pillai's Trace) which can be difficult to interpret, especially when they disagree 30.
  3. Curse of Dimensionality: With many dependent variables, the number of parameters to estimate grows rapidly. In high-dimensional data (e.g., thousands of voxels in fMRI), the residual variance-covariance matrix can become singular if the number of dependent variables exceeds the number of observations minus the number of predictors. This necessitates regularization techniques or alternative approaches like Multivoxel Pattern Analysis (MVPA) 31.

Path Analysis

Path Analysis is used when independent and dependent variables can directly affect each other, forming a system of regressions. It distinguishes between:

  • Exogenous variables: Variables that are not explained by other variables in the model (only influenced by external factors or error).
  • Endogenous variables: Variables that are explained by other variables within the model (can be both dependent and independent) 32.

The model is represented using path diagrams. A classic path analysis deals with observed variables; path diagrams with latent variables are termed Structural Equation Models (SEM) 33.

Mediation

A key concept in path analysis is mediation, where one variable (ZZ) explains the relationship between an independent variable (XX) and a dependent variable (YY) by acting as an intermediate 32.

  • Direct path: X→YX \rightarrow Y, with effect γ21\gamma_{21}.
  • Indirect path: X→Z→YX \rightarrow Z \rightarrow Y, with effect β21γ11\beta_{21}\gamma_{11}.
  • Total effect: The sum of the direct and indirect effects (γ21+β21γ11\gamma_{21} + \beta_{21}\gamma_{11}) 33.

Confounder, mediator, moderator, and collider

These terms describe different roles a third variable (ZZ) can play in relation to an independent variable (XX) and a dependent variable (YY) 34:

  • Moderator: Changes the strength or direction of the X→YX \rightarrow Y path.
  • Mediator: Explains the X→YX \rightarrow Y relationship through an indirect path (X→Z→YX \rightarrow Z \rightarrow Y).
  • Confounder: Affects both XX and YY, potentially creating a spurious association. Confounders must be controlled for in the analysis.
  • Collider: Is caused by both XX and YY. Colliders should not be controlled for, as doing so can induce spurious associations (selection bias).

Fixed versus random effects

In many statistical models, particularly those analyzing data with hierarchical structures (e.g., students within schools, patients over time), it's important to distinguish between fixed and random effects 35.

  • Fixed effects: Coefficients are treated as specific, constant values representing the direct effect of a predictor. In fMRI, individual regression coefficients for a task might be treated as fixed effects for that specific subject.
  • Random effects: Coefficients are considered realizations from a random variable, representing variability across different groups or individuals. This approach assumes an infinite population of such effects 37.

Mixed-Effects Models

Mixed-effects models combine both fixed and random effects. They are particularly useful for:

  • Accounting for hierarchical structure: Recognizing that observations within groups are not independent.
  • Estimating variance components: Estimating variability both between groups (e.g., between-subjects variance, σB2\sigma^2_B) and within groups (e.g., within-subject variance, σW2\sigma^2_W) 37.

A common application is in longitudinal studies, where individuals are followed over time. A model might include:

  • A fixed intercept and slope representing the average effects across all individuals.
  • Random intercepts and slopes for each individual, capturing their unique deviations from the average 38 39.

The model structure can be: Y=(α+u0)+(β1+u1)X+ϵY = (\alpha + u_0) + (\beta_1 + u_1)X + \epsilon where α\alpha and β1\beta_1 are fixed effects, u0u_0 and u1u_1 are random effects (e.g., normally distributed with mean 0 and variances σu02\sigma^2_{u0}, σu12\sigma^2_{u1}), and ϵ\epsilon is the residual error 39.

Note: Mixed-effects models offer a compromise between "no pooling" (fitting separate models for each group, like ANCOVA) and "complete pooling" (fitting a single model for all data). They provide "semi-pooling," allowing for borrowing strength across groups while still accounting for individual differences 44.

Comparison with ANOVA and Moderation

ApproachEquationdfXdf_XdfZdf_ZdfXZdf_{XZ}dfResdf_{Res}Variances
ANOVA WithinY=α+β1X+β2Z+ϵY = \alpha + \beta_1X + \beta_2Z + \epsilonT−1T-1n−1n-10(T−1)(n−1)(T-1)(n-1)σ2\sigma^2
Moderation (X categorical)Y=α+β1X+β2Z+β3XZ+ϵY = \alpha + \beta_1X + \beta_2Z + \beta_3XZ + \epsilonT−1T-1n−1n-1(T−1)(n−1)(T-1)(n-1)0σ2\sigma^2
Moderation (X continuous)Y=α+β1X+β2Z+β3XZ+ϵY = \alpha + \beta_1X + \beta_2Z + \beta_3XZ + \epsilon1n−1n-1n−1n-1(T−2)n(T-2)nσ2\sigma^2
Mixed-Effect modelY=α+u0+(β1+u1)X+ϵY = \alpha + u_0 + (\beta_1 + u_1)X + \epsilon100Debatedσ2,σu02,σu12\sigma^2, \sigma^2_{u0}, \sigma^2_{u1}

Within-subject ANOVA and simple moderation models treat all effects as fixed. Mixed-effects models significantly reduce the number of parameters by treating some effects as random, leading to more efficient estimation, though the degrees of freedom for testing can be complex 41.

Intraclass Correlation Coefficient (ICC)

The ICC quantifies the proportion of total variance attributable to between-group differences. For a model with random intercepts: ρ0=σu02σu02+σ2\rho_0 = \frac{\sigma^2_{u0}}{\sigma^2_{u0} + \sigma^2} where σu02\sigma^2_{u0} is the variance of the random intercepts (between-group variance) and σ2\sigma^2 is the within-group variance 42.

Important: The ICC ρ0\rho_0 is an "unconditional" ICC. In models with random slopes, a "conditional" ICC which depends on XX might be more appropriate but is more complex to calculate 42.

Generalized Linear Model (GLM)

Generalized Linear Models (GLMs) extend linear regression to accommodate dependent variables that are not normally distributed and are not necessarily continuous 45.

The need for GLM

When the dependent variable (YY) is categorical (e.g., binary: Yes/No), a standard linear regression model is inappropriate because:

  1. The predicted values (probabilities) can fall outside the range 0 1.
  2. The assumption of normally distributed errors with constant variance is violated 45 46.

GLMs address this by:

  1. Specifying a distribution for Y: The distribution of YY belongs to the exponential family (e.g., Bernoulli, Poisson, Gamma).
  2. Defining a linear predictor: η=α+β1X1+⋯+βpXp\eta = \alpha + \beta_1X_1 + \dots + \beta_pX_p.
  3. Using a link function (gg): A monotonic and differentiable function that connects the expected value of YY (μ=E(Y∣X)\mu = E(Y|X)) to the linear predictor: μ=g−1(η)\mu = g^{-1}(\eta) 47.

Simple Logistic Regression

A common GLM is logistic regression, used when the dependent variable is binary (Bernoulli distributed).

  • Probability: P(Y=1∣X)=p(X)P(Y=1|X) = p(X). The expected value is μ=E(Y∣X)=p(X)\mu = E(Y|X) = p(X).
  • Link function: For the Bernoulli distribution, the logit function is typically used: logit(p)=ln⁡(p1−p)logit(p) = \ln\left(\frac{p}{1-p}\right) This function, also known as the log-odds, transforms the probability (bounded between 0 and 1) into a variable that ranges from −∞-\infty to +∞+\infty 47.

The model equation becomes: logit(p(X))=ln⁡(p(X)1−p(X))=α+βXlogit(p(X)) = \ln\left(\frac{p(X)}{1-p(X)}\right) = \alpha + \beta X This linear relationship between the log-odds and the predictor allows for estimation using methods like Maximum Likelihood Estimation (MLE) 48.

Representations of Logistic Regression

The relationship can be expressed in three equivalent ways 48:

  1. Logit/Log-odds: ln⁡(P(Y=1∣X)1−P(Y=1∣X))=α+βX\ln\left(\frac{P(Y = 1|X)}{1 - P(Y = 1|X)}\right) = \alpha + \beta X
  2. Odds: P(Y=1∣X)1−P(Y=1∣X)=eα+βX\frac{P(Y = 1|X)}{1 - P(Y = 1|X)} = e^{\alpha + \beta X}
  3. Probability: P(Y=1∣X)=eα+βX1+eα+βXP(Y = 1|X) = \frac{e^{\alpha + \beta X}}{1 + e^{\alpha + \beta X}} (This is the logistic function, hence "logistic regression").

Parameter interpretation

  • Intercept (α\alpha): Represents the log-odds of Y=1Y=1 when X=0X=0. eαe^\alpha is the odds of Y=1Y=1 when X=0X=0.
  • Coefficient (β\beta): Represents the change in the log-odds for a one-unit increase in XX. eβe^\beta is the odds-ratio, indicating how much the odds of Y=1Y=1 are multiplied for each unit increase in XX 50.

Example: If β=0.5\beta = 0.5, then eβ≈1.65e^\beta \approx 1.65. This means for every one-unit increase in the test score (XX), the odds of a positive diagnosis (Y=1Y=1) are multiplied by approximately 1.65 50.

Hat Matrix Formulation

The Hat Matrix (HH), also known as the projection or influence matrix, plays a crucial role in understanding the relationship between observed and predicted values in linear regression 52.

In matrix form, the simple linear regression model is y=Xβ+ey = X\beta + e, where β^=(XTX)−1XTy\hat{\beta} = (X^TX)^{-1}X^Ty is the OLS solution. The predicted values (y^\hat{y}) are then: y^=Xβ^=X(XTX)−1XTy=Hy\hat{y} = X\hat{\beta} = X(X^TX)^{-1}X^Ty = Hy The matrix H=X(XTX)−1XTH = X(X^TX)^{-1}X^T is the hat matrix 52.

Properties of the Hat Matrix

The Hat matrix HH and the related Residual Maker Matrix (I−HI - H) have important properties 54: a) Symmetric: HT=HH^T = H and (I−H)T=I−H(I - H)^T = I - H. b) Idempotent: H2=HH^2 = H and (I−H)2=I−H(I - H)^2 = I - H.

The residuals (ee) can be computed as e=y−y^=(I−H)ye = y - \hat{y} = (I - H)y 54.

Leverage values

The diagonal elements of the hat matrix, hiih_{ii}, are called leverage values. They measure how much the ii-th observation's independent variable value (xix_i) deviates from the mean of the independent variables. Higher leverage values indicate that an observation has a greater potential to influence the regression line 53.

For simple linear regression, the leverage value for the ii-th observation is: hii=1n+(xi−xˉ)2∑j=1n(xj−xˉ)2h_{ii} = \frac{1}{n} + \frac{(x_i - \bar{x})^2}{\sum_{j=1}^{n}(x_j - \bar{x})^2} 53.

The variance of a single residual eie_i is given by: Var(ei)=σ2(1−hii)Var(e_i) = \sigma^2(1 - h_{ii}) This shows that residuals associated with high leverage points have smaller variances 54.

The sum of squared residuals can be expressed using the hat matrix: SSRes=eTe=yT(I−H)T(I−H)y=yT(I−H)ySS_{Res} = e^Te = y^T(I - H)^T(I - H)y = y^T(I - H)y 54.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also