Lecture slides stats1.13.l23.air
description
Transcript of Lecture slides stats1.13.l23.air
![Page 1: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/1.jpg)
Statistics One
Lecture 23 Generalized Linear Model
![Page 2: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/2.jpg)
Two segments
• Overview • Examples
2
![Page 3: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/3.jpg)
Lecture 23 ~ Segment 1
Generalized Linear Model Overview
![Page 4: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/4.jpg)
Generalized Linear Model
• An extension of the General Linear Model that allows for non-normal distributions in the outcome variable and therefore also allows testing of non-linear relationships between a set of predictors and the outcome variable
4
![Page 5: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/5.jpg)
Generalized Linear Model
• Generalized Linear Model: GLM* • General Linear Model: GLM
5
![Page 6: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/6.jpg)
General Linear Model (GLM)
• GLM is the mathematical framework used in many common statistical analyses, including multiple regression and ANOVA
6
![Page 7: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/7.jpg)
Characteristics of GLM
• Linear: pairs of variables are assumed to have linear relations
• Additive: if one set of variables predict another variable, the effects are thought to be additive
7
![Page 8: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/8.jpg)
Characteristics of GLM
• BUT! This does not preclude testing non-linear or non-additive effects
8
![Page 9: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/9.jpg)
Characteristics of GLM
• GLM can accommodate such tests, for example, by
• Transformation of variables – Transform so non-linear becomes linear
• Moderation analysis – Fake the GLM into testing non-additive effects
9
![Page 10: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/10.jpg)
GLM example
• Simple regression • Y = B0 + B1X1 + e
• Y = faculty salary • X1 = years since PhD
10
![Page 11: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/11.jpg)
GLM example
• Multiple regression • Y = B0 + B1X1 + B2X2 + B3X3 + e
• Y = faculty salary • X1 = years since PhD • X2 = number of publications • X3 = (years x pubs)
11
![Page 12: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/12.jpg)
Generalized linear model (GLM*)
• Appropriate when simple transformations or product terms are not sufficient
12
![Page 13: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/13.jpg)
Generalized linear model (GLM*)
• The “linear” model is allowed to generalize to other forms by adding a “link function”
13
![Page 14: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/14.jpg)
Generalized linear model (GLM*)
• For example, in binary logistic regression, the logit function was the link function
14
![Page 15: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/15.jpg)
Binary logistic regression
• ln(Ŷ / (1 - Ŷ)) = B0 + Σ(BkXk)
15
Ŷ = predicted value on the outcome variable Y B0 = predicted value on Y when all X = 0 Xk = predictor variables Bk = unstandardized regression coefficients (Y – Ŷ) = residual (prediction error) k = the number of predictor variables
![Page 16: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/16.jpg)
Segment summary
• GLM* is an extension of GLM that allows for non-normal distributions in the outcome variable and therefore also allows testing of non-linear relationships between a set of predictors and the outcome variable
16
![Page 17: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/17.jpg)
Segment summary
• Appropriate when simple transformations or product terms are not sufficient
17
![Page 18: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/18.jpg)
Segment summary
• The “linear” model is allowed to generalize to other forms by adding a “link function”
18
![Page 19: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/19.jpg)
END SEGMENT
![Page 20: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/20.jpg)
Lecture 23 ~ Segment 2
Generalized Linear Model Examples
![Page 21: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/21.jpg)
GLM* Examples
• GLM* is an extension of GLM that allows for non-normal distributions in the outcome variable and therefore also allows testing of non-linear relationships between a set of predictors and the outcome variable
21
![Page 22: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/22.jpg)
GLM* Examples
• Appropriate when simple transformations or product terms are not sufficient
22
![Page 23: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/23.jpg)
GLM* Examples
• The “linear” model is allowed to generalize to other forms by adding a “link function”
23
![Page 24: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/24.jpg)
GLM* Examples
• Binary logistic regression
24
![Page 25: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/25.jpg)
Binary logistic regression
![Page 26: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/26.jpg)
GLM* Examples
• In binary logistic regression, the logit function served as the link function
26
![Page 27: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/27.jpg)
GLM* Examples
• ln(Ŷ / (1 - Ŷ)) = B0 + Σ(BkXk)
27
Ŷ = predicted value on the outcome variable Y B0 = predicted value on Y when all X = 0 Xk = predictor variables Bk = unstandardized regression coefficients (Y – Ŷ) = residual (prediction error) k = the number of predictor variables
![Page 28: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/28.jpg)
GLM* Examples
• More than 2 categories on the outcome – Multinomial logistic regression • A-1 logistic regression equations are formed
– Where A = # of groups – One group serves as reference group
![Page 29: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/29.jpg)
GLM* Examples
• Another example is Poisson regression • Poission distributions are common with
“count data” – A number of events occurring in a fixed interval
of time
29
![Page 30: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/30.jpg)
GLM* Examples
• For example, the number of traffic accidents as a function of weather conditions – Clear weather – Rain – Snow
30
![Page 31: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/31.jpg)
Poisson regression
31
![Page 32: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/32.jpg)
GLM* Examples
• In Poisson regression, the log function serves as the link function
• Note: this example also has a categorical predictor and would therefore also require dummy coding
32
![Page 33: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/33.jpg)
Segment summary
• GLM* is an extension of GLM that allows for non-normal distributions in the outcome variable and therefore also allows testing of non-linear relationships between a set of predictors and the outcome variable
33
![Page 34: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/34.jpg)
Segment summary
• Appropriate when simple transformations or product terms are not sufficient
34
![Page 35: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/35.jpg)
Segment summary
• The “linear” model is allowed to generalize to other forms by adding a “link function”
35
![Page 36: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/36.jpg)
END SEGMENT
![Page 37: Lecture slides stats1.13.l23.air](https://reader033.fdocuments.net/reader033/viewer/2022052622/5590d43d1a28ab5b148b46a2/html5/thumbnails/37.jpg)
END LECTURE 23