What is multiple regression?
Fitting multiple regression to data.
Multicollinearity.
Inference with fit models
yi=β0+β1xi+ϵi ϵi∼N(0,σ)
yi=β0+β1xi+ϵi ϵi∼N(0,σ)
This corresponds to
yi=β0+β1x1i+β2x2i+ϵi ϵi∼N(0,σ)
Exogeneity: Xs are not correlated with e.
Low collinearity ∣rx1x2∣ less that ~ 0.7 or 0.8
We can always calculate correlations.
rxy=σxyσxσy
We can always calculate correlations.
rxy=σxyσxσy
Now we can look at a correlation matrix
ρXi,Y=YX1X2Y10.20.5X11−0.3X21
We can always calculate correlations.
rxy=σxyσxσy
Now we can look at a correlation matrix
ρXi,Y=YX1X2Y10.20.5X11−0.3X21
From this, we can calculate partial correlations
Answers, what is the correlation between Xi and Y if we remove the portion of X1 correlated with X2
Answers, what is the correlation between Xi and Y if we remove the portion of X1 correlated with X2
ryx1,x2=ryx1−ryx2rx1x2√(1−r2x1x2)(1−r2yx2)
Answers, what is the correlation between Xi and Y if we remove the portion of X1 correlated with X2
ryx1,x2=ryx1−ryx2rx1x2√(1−r2x1x2)(1−r2yx2)
Answers, what is the correlation between Xi and Y if we remove the portion of X1 correlated with X2
ryx1,x2=ryx1−ryx2rx1x2√(1−r2x1x2)(1−r2yx2)
Subtract out the correlation of X2 on Y controlling for the correlation between X1 and X2
Scale by variability left over after accounting for the same
Answers, what is the correlation between Xi and Y if we remove the portion of X1 correlated with X2
ryx1,x2=ryx1−ryx2rx1x2√(1−r2x1x2)(1−r2yx2)
Subtract out the correlation of X2 on Y controlling for the correlation between X1 and X2
Scale by variability left over after accounting for the same
βyx1,x2=ρyx1,x2σx1σy
SStotal=SSmodel+SSerror
SStotal=SSmodel+SSerror
∑(Yi−ˉY)2=∑(^Yi−ˉY)2+∑(Yi−^Yi)2
SStotal=SSmodel+SSerror
∑(Yi−ˉY)2=∑(^Yi−ˉY)2+∑(Yi−^Yi)2
We are trying to minimize SSerror and partition SSmodel between X1 and X2
Each area is a sums of squares (i.e., amount of variability)
The variation in X2 associated with Y
How can we partition this? What is unique?
How do we represent our models that go beyond 2 predictors...
yi=β0+β1x1i+β2x2i+ϵi ϵi∼N(0,σ)
How do we represent our models that go beyond 2 predictors...
yi=β0+β1x1i+β2x2i+ϵi ϵi∼N(0,σ)
yi=β0+K∑j=1β1xij+ϵi ϵi∼N(0,σ)
For a simple linear regression: [y1y2y3y4y5y6y7]=[1x11x21x31x41x51x61x7][β0β1]+[ε1ε2ε3ε4ε5ε6ε7]
[Y1Y2⋮Yn]=[1X11X12⋯X1,p−11X21X22⋯X2,p−1⋮⋮⋮⋮1Xn1Xn2⋯Xn,p−1]×[β0β1⋮βp−1]+[ϵ1ϵ2⋮ϵn]
[Y1Y2⋮Yn]=[1X11X12⋯X1,p−11X21X22⋯X2,p−1⋮⋮⋮⋮1Xn1Xn2⋯Xn,p−1]×[β0β1⋮βp−1]+[ϵ1ϵ2⋮ϵn]
ˆY=Xβ Y∼N(ˆY,Σ)
ˆY=Xβ Y∼N(ˆY,Σ)
This equation is huge. X can be anything - categorical, continuous, squared, sine, etc.
There can be straight additivity, or interactions
What is multiple regression?
Fitting multiple regression to data
Multicollinearity
Inference with fit models
Five year study of wildfires & recovery in Southern California shurblands in 1993. 90 plots (20 x 50m)
(data from Jon Keeley et al.)
Richnessi=β0+β1coveri+β2firesevi+β3heteroi+ϵi
ϵi∼N(0,σ2)
Richnessi=β0+β1coveri+β2firesevi+β3heteroi+ϵi
ϵi∼N(0,σ2) In R code:
klm <- lm(rich ~ cover + firesev + hetero, data=keeley)
Data Generating Process: Linearity
Error Generating Process: Normality & homoscedasticity of residuals
Data Generating Process: Linearity
Error Generating Process: Normality & homoscedasticity of residuals
Data: Outliers not influencing residuals
Data Generating Process: Linearity
Error Generating Process: Normality & homoscedasticity of residuals
Data: Outliers not influencing residuals
Predictors: Minimal multicollinearity
What is multiple regression?
Fitting multiple regression to data.
Multicollinearity
Inference with fit models
Adding more predictors decreases precision of estimates
If predictors are too collinear, can lead to difficulty fitting model
Adding more predictors decreases precision of estimates
If predictors are too collinear, can lead to difficulty fitting model
If predictors are too collinear, can inflate SE of estimates further
Adding more predictors decreases precision of estimates
If predictors are too collinear, can lead to difficulty fitting model
If predictors are too collinear, can inflate SE of estimates further
If predictors are too collinear, are we really getting unique information
cover firesev heterocover 1.0000000 -0.43713460 -0.16837784firesev -0.4371346 1.00000000 -0.05235518hetero -0.1683778 -0.05235518 1.00000000
Correlations over 0.4 can be problematic, but, meh, they may be OK even as high as 0.8.
To be sure, we should look at how badly they change the SE around predictors.
Consider our model:
y=β0+β1x1+β2x2+ϵ
Consider our model:
y=β0+β1x1+β2x2+ϵ
We can also model:
X1=α0+α2x2+ϵj
The variance of X1 associated with other predictors is R21
Consider our model:
y=β0+β1x1+β2x2+ϵ
We can also model:
X1=α0+α2x2+ϵj
The variance of X1 associated with other predictors is R21
In MLR, the variance around our parameter estimate (square of SE) is:
var(β1)=σ2(n−1)σ2X111−R21
Consider our model:
y=β0+β1x1+β2x2+ϵ
We can also model:
X1=α0+α2x2+ϵj
The variance of X1 associated with other predictors is R21
In MLR, the variance around our parameter estimate (square of SE) is:
var(β1)=σ2(n−1)σ2X111−R21
The second term in that equation is the Variance Inflation Parameter
VIF=11−R21
VIF1=11−R21
VIF > 5 or 10 can be problematic and indicate an unstable solution.
Cry.
Evaluate why
Cry.
Evaluate why
Cry.
Evaluate why
Can drop a predictor if information is redundant
Can combine predictors into an index
Add them? Or other combination.
PCA for orthogonal axes
Factor analysis to compress into one variable
What is multiple regression?
Fitting multiple regression to data.
Multicollinearity.
Inference with fit models
Richnessi=β0+β1coveri+β2firesevi+β3heteroi+ϵi
term | estimate | std.error |
---|---|---|
(Intercept) | 1.68 | 10.67 |
cover | 15.56 | 4.49 |
firesev | -1.82 | 0.85 |
hetero | 65.99 | 11.17 |
Richnessi=β0+β1coveri+β2firesevi+β3heteroi+ϵi
term | estimate | std.error |
---|---|---|
(Intercept) | 1.68 | 10.67 |
cover | 15.56 | 4.49 |
firesev | -1.82 | 0.85 |
hetero | 65.99 | 11.17 |
β0 - the intercept - is the # of species when all other predictors are 0
All other βs are the effect of a 1 unit increase on # of species
rxy=bxysdxsdy
# Standardization method: basicParameter | Std. Coef. | 95% CI-----------------------------------------(Intercept) | 0.00 | [ 0.00, 0.00]cover | 0.33 | [ 0.14, 0.51]firesev | -0.20 | [-0.38, -0.01]hetero | 0.50 | [ 0.33, 0.67]
rxy=bxysdxsdy
# Standardization method: basicParameter | Std. Coef. | 95% CI-----------------------------------------(Intercept) | 0.00 | [ 0.00, 0.00]cover | 0.33 | [ 0.14, 0.51]firesev | -0.20 | [-0.38, -0.01]hetero | 0.50 | [ 0.33, 0.67]
r.squared | adj.r.squared |
---|---|
0.41 | 0.39 |
r.squared | adj.r.squared |
---|---|
0.41 | 0.39 |
41% of the variation in # of species is associated with the predictors
Note that this is all model, not individual predictors
r.squared | adj.r.squared |
---|---|
0.41 | 0.39 |
41% of the variation in # of species is associated with the predictors
Note that this is all model, not individual predictors
What is multiple regression?
Fitting multiple regression to data.
Multicollinearity.
Inference with fit models
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |