Inference for multiple regression

IMS, Ch. 25

Smith College

Apr 22, 2026

Inference for multiple regression

Example: NYC restaurants

library(tidyverse)
nyc <- read_csv("http://www.math.smith.edu/~bbaumer/mth241/nyc.csv")
ggplot(data = nyc, aes(x = Service, y = Price)) +
  geom_jitter(width = 0.1, alpha = 0.5, size = 2) + 
  geom_smooth(method = "lm", se = 0) +
  xlab("Jittered service rating") + 
  ylab("Average Price (US$)")
mod <- lm(Price ~ Food + Decor + Service + East, data = nyc)

Model output

summary(mod)

Call:
lm(formula = Price ~ Food + Decor + Service + East, data = nyc)

Residuals:
     Min       1Q   Median       3Q      Max 
-14.0465  -3.8837   0.0373   3.3942  17.7491 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept) -24.023800   4.708359  -5.102 9.24e-07 ***
Food          1.538120   0.368951   4.169 4.96e-05 ***
Decor         1.910087   0.217005   8.802 1.87e-15 ***
Service      -0.002727   0.396232  -0.007   0.9945    
East          2.068050   0.946739   2.184   0.0304 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 5.738 on 163 degrees of freedom
Multiple R-squared:  0.6279,    Adjusted R-squared:  0.6187 
F-statistic: 68.76 on 4 and 163 DF,  p-value: < 2.2e-16

Check conditions

library(performance)
check_model(mod, check = c("linearity", "qq", "homogeneity", "outliers"))

Design questions

  • If linearity is violated:
    • Is the model is mis-specified?
    • Would a transformation help?
  • If independence is violated:
    • Is your sample representative?

Distribution of residuals conditions

  • If normality is violated:
    • How big is your sample size?
    • Would a transformation help?
    • Can you bootstrap instead?
  • If equal variance is violated?
    • Would a transformation help?
    • Can you bootstrap instead?
  • You will learn more in SDS 291!

Multicollinearity

  • Are the explanatory variables highly correlated with each other?
  • Yes? Uh-oh, take SDS 291

Cross-validation

  • Take SDS 293!