3
Caitlyn Donadt & Morganne Wall The Problem with Linear Assumptions 1. Normality 2. Homogeneity 3. Fixed X 4. Independence 5. Correct Model Specification Model Validation > op <- par(mfrow = c(2, 2), mar = c(5, 4, 1, 2)) #specifies a graphing window with 4 panels > plot(Model1, add.smooth = FALSE, which = 1) > E <- resid(M1) > hist(E, xlab = "Residuals", main = "") > plot(Dataset$Length, E, xlab = "Log(Length)", ylab = "Residuals") > plot(Dataset$Month, E, xlab = "Month", ylab = "Residuals") > par(op) Figure 2.7 from Zuur 2009 using the Clams dataset available with the textbook... Ecological Considerations The world is not always normal Poisson Distribution Negative Binomial Distribution

Model Validation - University of Albertaahamann/teaching/renr690/LabGLMppt.pdf · Binomial Logit Mixed Generalized Linear Model Loglinear Poisson Log Categorical Generalized Linear

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Model Validation - University of Albertaahamann/teaching/renr690/LabGLMppt.pdf · Binomial Logit Mixed Generalized Linear Model Loglinear Poisson Log Categorical Generalized Linear

Caitlyn Donadt & Morganne Wall

The Problem with Linear

Assumptions

1. Normality

2. Homogeneity

3. Fixed X

4. Independence

5. Correct Model Specification Model Validation

> op <- par(mfrow = c(2, 2), mar = c(5, 4, 1, 2))

#specifies a graphing window with 4 panels

> plot(Model1, add.smooth = FALSE, which = 1)

> E <- resid(M1)

> hist(E, xlab = "Residuals", main = "")

> plot(Dataset$Length, E, xlab = "Log(Length)", ylab =

"Residuals")

> plot(Dataset$Month, E, xlab = "Month", ylab =

"Residuals")

> par(op)

Figure 2.7 from Zuur 2009 using the Clams dataset available with the textbook...

Ecological Considerations

The world is not always normal

Poisson Distribution

Negative Binomial Distribution

Page 2: Model Validation - University of Albertaahamann/teaching/renr690/LabGLMppt.pdf · Binomial Logit Mixed Generalized Linear Model Loglinear Poisson Log Categorical Generalized Linear

Gamma Distribution

Infinite number of

What is a

Model Random Link

Systematic

Type

Linear

Regression

Normal Identity Continuous General

Linear

Model

ANOVA Normal Identity Categorical General

Linear

Model

ANCOVA Normal Identity Mixed General

Linear

Model

Logistic

Regression

Binomial Logit Mixed Generalized

Linear

Model

Loglinear Poisson Log Categorical Generalized

Linear

Model

Poisson

Regression

Poisson Log Mixed Generalized

Linear

Model

Note: modified from 6.1 Introduction to Generalized Linear

Models, buy The Pennsylvania State University, retrieved from

https://onlinecourses.science.psu.edu/stat504/node/216

Copyright 2018 by The Pennsylvania State University

What is a

Model Random Link

Systematic

Type

Linear

Regression

Normal Identity Continuous General

Linear

Model

ANOVA Normal Identity Categorical General

Linear

Model

ANCOVA Normal Identity Mixed General

Linear

Model

Logistic

Regression

Binomial Logit Mixed Generalized

Linear

Model

Loglinear Poisson Log Categorical Generalized

Linear

Model

Poisson

Regression

Poisson Log Mixed Generalized

Linear

Model

Note: modified from 6.1 Introduction to Generalized Linear

Models, buy The Pennsylvania State University, retrieved from

https://onlinecourses.science.psu.edu/stat504/node/216

Copyright 2018 by The Pennsylvania State University

What is a

Model Random Link

Systematic

Type

Linear

Regression

Normal Identity Continuous General

Linear

Model

ANOVA Normal Identity Categorical General

Linear

Model

ANCOVA Normal Identity Mixed General

Linear

Model

Logistic

Regression

Binomial Logit Mixed Generalized

Linear

Model

Loglinear Poisson Log Categorical Generalized

Linear

Model

Poisson

Regression

Poisson Log Mixed Generalized

Linear

Model

Note: modified from 6.1 Introduction to Generalized Linear

Models, buy The Pennsylvania State University, retrieved from

https://onlinecourses.science.psu.edu/stat504/node/216

Copyright 2018 by The Pennsylvania State University

GLM = Random component + systematic component + link function

Random component

0

1x

1

2x

2

0 1x

1 2x

22 2Systematic component

simple linear regression:

0

1xi

loglinear model:

Page 3: Model Validation - University of Albertaahamann/teaching/renr690/LabGLMppt.pdf · Binomial Logit Mixed Generalized Linear Model Loglinear Poisson Log Categorical Generalized Linear

Link function

An example of GLM model notation

Yi i)

We are using poisson distribution for

our random component

E(Yi i and var(Yi i

i) = × D.PARKi

Link Systematic component

Model Random Link

Systematic

Type

Logistic Regression Binomial Logit Mixed Generalized

Linear Model

Loglinear Poisson Log Categorical Generalized

Linear Model

Poisson Regression Poisson Log Mixed Generalized

Linear Model

Note: modified from 6.1 Introduction to Generalized Linear Models, buy The Pennsylvania State University, retrieved from

https://onlinecourses.science.psu.edu/stat504/node/216

Copyright 2018 by The Pennsylvania State University

References

personal communication, January 8 2018).

The Pennsylvania State University (2008). Lesson 7: GLM and

Poisson Regression. Retrieved from

http://personal.psu.edu/abs12//stat504/online/07_poisson/02_poi

sson_beyond.htm

The Pennsylvania State University (2018).

6.1 - Introduction to Generalized Linear Models. Retrieved from

https://onlinecourses.science.psu.edu/stat504/node/216 March

26, 2018

Zuur A. F. (2009). Mixed effects models and extensions in

Ecology with R.