faraway
Table of contents and R scripts for 3rd Edition of Linear Models with R
Click the heading to get individual scripts or
download a zip file of all the scripts
Introduction
Before You Start
Initial Data Analysis
When to Use Linear Modeling
History
Estimation
Linear Model
Matrix Representation
Estimating β
Least Squares Estimation
Examples of Calculating β
Example
Intercept
QR Decomposition
Gauss–Markov Theorem
Goodness of Fit
Identifiability
Orthogonality
Inference
Hypothesis Tests to Compare Models
Testing Examples
Confidence Intervals for β
Problems with inference
Sampling
Simulation
Sampling Models
Permutation Tests
Bootstrap Confidence Intervals
Prediction
Confidence and Prediction Intervals for Predictions
Predicting Body Fat
Prediction Model Assessment
Autoregression
What Can Go Wrong with Predictions?
Explanation
Explanation by Prediction
Confounding and Simpson’s Paradox
Counterfactuals
Insulation Example
Designed Experiments
New Hampshire Primary Example
Qualitative Support for Causation
Summary
Diagnostics
Checking Error Assumptions
Finding Unusual Observations
Checking the Systematic Structure of the Model
Discussion
Problems with the Predictors
Errors in the Predictors
Changes of Scale
Collinearity
Problems with the Error
Generalized Least Squares
Weighted Least Squares
Testing for Lack of Fit
Robust Regression
Transformation
Choosing a Transform on the Response
Algorithms for Transforming the Response
Transforming the Predictors
Segmented Regression
Polynomials
Splines
Additive Models
Model Selection
Models with a Hierarchy
Testing-Based Procedures
Criterion-Based Procedures
Crossvalidation
Summary
Regularization
Principal Components
Partial Least Squares
Ridge Regression
Lasso
Elastic Net
Insurance Redlining — A Complete Example
Ecological Correlation
Initial Data Analysis
Full Model and Diagnostics
Sensitivity Analysis
Discussion
Missing Data
Types of Missing Data
Deletion
Single Imputation
Multiple Imputation
Categorical Predictors
A Two-Level Factor
Factors and Quantitative Predictors
More Lessons from the Hips Study
Interpretation with Interaction Terms
Factors With More Than Two Levels
Contrasts and Factor Codings
One Factor Models
The Model
An Example
Analysis of Variance
Other Factor Codings
Diagnostics
Pairwise Comparisons
False Discovery Rate
Design Considerations
Models with Several Factors
Two Factors with No Replication
Estimated Marginal Means and Multiple Comparisons
Ordinal Factors
Two Factors with Replication
Two Factors with an Interaction
Design for Two Factor Experiments
Larger Factorial Experiments
Experiments with Blocks
Randomized Block Design
Latin Squares
Balanced Incomplete Block Design