today: lab 9ab due after lecture: ceq monday: quizz 11: review
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 PresentationTRANSCRIPT
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
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.
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
GLM, GzLM, GAM
A few concepts and ideas
GLM
Model based statistics – we define the response and the explanatory without worrying about the name of the test
GLM
t-test
ANOVA
Simple Linear Regression
Multiple Linear Regression
ANCOVA
GENERAL LINEAR MODELS
ε ~ Normal R: lm()
GLM
An example from Lab 9
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
GLM
0 2 4 6 8 10 12
-4-2
02
4
worm.lm$fitted.values
wor
m.lm
$res
idua
ls
N=25
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
GLM
N=25worm.lm$residuals
Fre
qu
en
cy
-4 -2 0 2 4
02
46
8
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]
GLM
p-value borderline
Normality assumption not met
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)
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?
GLMResponse variable?
Counts
GzLMPoisson error
#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column
GzLMPoisson error
#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column
ALL fits > 0
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
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
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
GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column
Generalized linear models have 3 components:
Systematic
Random
Link function
GzLM#ww = eμ + ε μ = β0 + βtreatment treatment + βrow row + βcolumn column
Generalized linear models have 3 components:
Systematic
linear predictor
Random
Link function
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
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
GzLM
GLM
An example from Lab 6
2 4 6 8 10 12
01
02
03
04
0
period
dist
ance
GLM
Do movements of juvenile cod depend on time of day?
distance = β0 + βperiod period
period categorical
GLM
GLM
2 4 6 8 10 12
01
02
03
04
0
period
dist
ance
Anything wrong with this analysis?
GAM
2 4 6 8 10 12
01
02
03
04
0
Time
Dis
tanc
e
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
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
GAMSmoothing - concept
Degree of smoothness- +
GAM
How much smoothing?
GAM
t-test
ANOVA
Simple Linear Regression
Multiple Linear Regression
ANCOVA
GENERAL LINEAR MODELS
ε ~ Normal R: lm()
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
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