today: lab 9ab due after lecture: ceq monday: quizz 11: review

39
Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review Wednesday: Guest lecture – Multivariate Analysis Friday: last lecture: review – Bring questions DEC 8 – 9am FINAL EXAM EN 2007

Upload: liluye

Post on 11-Jan-2016

46 views

Category:

Documents


1 download

DESCRIPTION

DEC 8 – 9am FINAL EXAM EN 2007. Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review Wednesday: Guest lecture – Multivariate Analysis Friday: last lecture: review – Bring questions. Biology 4605 / 7220Name ________________ Quiz #10a19 November 2012 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

Today:Lab 9ab dueafter lecture: CEQ

Monday:Quizz 11: review

Wednesday:Guest lecture – Multivariate Analysis

Friday:last lecture: review – Bring questions

DEC 8 – 9am

FINAL EXAMEN 2007

Page 2: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

Biology 4605 / 7220 Name ________________

Quiz #10a 19 November 2012

1. What are the 2 main differences between general linear models and generalized linear models?

2. A generalized linear model links a response variable to one or more explanatory variables Xi according to a link function.

Page 3: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

Biology 4605 / 7220 Name ________________

Quiz #10a 19 November 2012

1. What are the 2 main differences between general linear models and generalized linear models?

Most common answers:A. Non –normal εB. ANODEV instead of ANOVA tableC. Link function

2. A generalized linear model links a response variable to one or more explanatory variables Xi according to a link function.

conceptual

implementation

Page 4: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM, GzLM, GAM

A few concepts and ideas

Page 5: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

Model based statistics – we define the response and the explanatory without worrying about the name of the test

Page 6: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

GENERAL LINEAR MODELS

ε ~ Normal R: lm()

Page 7: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

An example from Lab 9

Page 8: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

Do fumigants (treatments) decrease the number of wire worms?

#ww = β0 + βtreatment treatment + βrow row + βcolumn column

treatment fixed

row random

column random

N=25

Page 9: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

0 2 4 6 8 10 12

-4-2

02

4

worm.lm$fitted.values

wor

m.lm

$res

idua

ls

N=25

Page 10: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

N=25-2 -1 0 1 2

-2-1

01

2

Theoretical Quantiles

Sta

ndar

dize

d re

sidu

als

lm(nw ~ trt + row + col)

Normal Q-Q

4

243

Page 11: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

N=25worm.lm$residuals

Fre

qu

en

cy

-4 -2 0 2 4

02

46

8

Page 12: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

N=25-4 -2 0 2 4

-4-2

02

4

worm.lm$residuals[1:24]

wor

m.lm

$res

idua

ls[2

:25]

Page 13: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

p-value borderline

Normality assumption not met

Page 14: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

N=25

p-value borderline

Normality assumption not met

n<30

Given that we do not violate the homogeneity assumption, randomizing will likely not change our decision… or will it?

Let’s try prand = 0.0626 (50 000 randomizations)

Page 15: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

0 1 2 3 4

-21

0

Treatment

Num

ber

of w

ire w

orm

sParameters:

Means with 95% CI

Anything wrong with this analysis?

Page 16: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLMResponse variable?

Counts

Page 17: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLMPoisson error

#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

Page 18: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLMPoisson error

#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

ALL fits > 0

Page 19: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLMPoisson error

0 1 2 3 4

-21

0

Normal error

Treatment

Num

ber

of w

ire w

orm

s

0 1 2 3 4

-21

0

Poisson error

Treatment

Page 20: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLMPoisson error

0 1 2 3 4

-21

0

Normal error

Treatment

Num

ber

of w

ire w

orm

s

0 1 2 3 4

-21

0

Poisson error

Treatment

Page 21: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

PoissonBinomial

Negative BinomialGamma

Multinomial

GENERALIZED LINEAR MODELS

Inverse Gaussian

Exponential

GENERAL LINEAR MODELS

ε ~ Normal

Linear combination of parameters

R: lm()

R: glm()

GzLM

Page 22: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

Generalized linear models have 3 components:

Systematic

Random

Link function

Page 23: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

Generalized linear models have 3 components:

Systematic

linear predictor

Random

Link function

Page 24: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

Generalized linear models have 3 components:

Systematic

linear predictor

Random

probability distribution poisson error

Link function

Page 25: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column

Generalized linear models have 3 components:

Systematic

linear predictor

Random

probability distribution poisson error

Link function

log

Page 26: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GzLM

Page 27: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

An example from Lab 6

2 4 6 8 10 12

01

02

03

04

0

period

dist

ance

Page 28: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

Do movements of juvenile cod depend on time of day?

distance = β0 + βperiod period

period categorical

Page 29: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

Page 30: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GLM

2 4 6 8 10 12

01

02

03

04

0

period

dist

ance

Anything wrong with this analysis?

Page 31: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GAM

2 4 6 8 10 12

01

02

03

04

0

Time

Dis

tanc

e

Page 32: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

PoissonBinomial

Negative BinomialGamma

Multinomial

GENERALIZED LINEAR MODELS

Inverse Gaussian

Exponential

Non-linear effect of covariates

GENERALIZED ADDITIVE MODELS

GENERAL LINEAR MODELS

ε ~ Normal

Linear combination of parameters

R: lm()

R: glm()

R: gam()GAM

Page 33: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GAM

Generalized case of generalized linear models where the systematic component is not necessarily linear

distance ~ s(period)

y ~ s(x1) + s(x2) + x3 + ….

s: smooth function

Spline functions are concerned with good approximation of functions over the whole of a region, and behave in a stable manner

Page 34: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GAMSmoothing - concept

Page 35: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

Degree of smoothness- +

GAM

How much smoothing?

Page 36: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

GAM

Page 37: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

GENERAL LINEAR MODELS

ε ~ Normal R: lm()

Page 38: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

PoissonBinomial

Negative BinomialGamma

Multinomial

GENERALIZED LINEAR MODELS

Inverse Gaussian

Exponential

GENERAL LINEAR MODELS

ε ~ Normal

Linear combination of parameters

R: lm()

R: glm()

Non-normal ε

Link function

Page 39: Today: Lab 9ab due after lecture: CEQ Monday: Quizz 11: review

t-test

ANOVA

Simple Linear Regression

Multiple Linear Regression

ANCOVA

PoissonBinomial

Negative BinomialGamma

Multinomial

GENERALIZED LINEAR MODELS

Inverse Gaussian

Exponential

Non-linear effect of covariates

GENERALIZED ADDITIVE MODELS

GENERAL LINEAR MODELS

ε ~ Normal

Linear combination of parameters

R: lm()

R: glm()

R: gam()

Linear predictor involves sums of smooth functions of covariates