BIOL 4605/7220
description
Transcript of BIOL 4605/7220
![Page 1: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/1.jpg)
BIOL 4605/7220
GPT LecturesCailin Xu
October 12, 2011
CH 9.3 Regression
![Page 2: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/2.jpg)
General Linear Model (GLM)
Last week (Dr. Schneider)
- Introduction to the General Linear Model
(GLM)
- Generic recipe for GLM
- 2 examples of Regression, a special case of
GLM
Ch 9.1 Explanatory Variable Fixed by
Experiment (experimentally fixed levels of phosphorus)
Ch 9.2 Explanatory Variable Fixed into Classes
(avg. height of fathers from families)
![Page 3: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/3.jpg)
General Linear Model (GLM)
Today – Another example of GLM
regression
Ch 9.3 Explanatory Variable Measured with Error (fish size)
Observational study
E.g., per female fish ~ fish body size M (observational study; fish size measured with error)
Based on knowledge, larger fish have more
eggs (egg size varies little within species; larger fish- more
energy)
![Page 4: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/4.jpg)
General Linear Model (GLM) --- Regression
Special case of GLM:
REGRESSION
Explanatory Variable Measured with
Error
Research question: - NOT: whether there is a relation - BUT: what the relation is? 1:1?, 2:1?, or ?
Parameters Estimates & CL & Interpret pars
(rather than hypothesis testing)
![Page 5: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/5.jpg)
General Linear Model (GLM) --- Regression
Go through GLM recipe with an
example
Explanatory Variable Measured with Error How egg # ( ) ~ female body size
(M)?
Ref: Sokal and Rohlf 1995 - Box 14.12
eggsN
![Page 6: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/6.jpg)
KiloEggs Wt61 1437 1765 2469 2554 2793 3387 3489 37100 4090 4197 42
![Page 7: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/7.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
State population; is sample representative?
Hypothesis testing? State pairAHH /0
ANOVA
Recompute p-value?
Declare decision: AHvsH .0Report & Interpr.of
parameters
Yes
No
![Page 8: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/8.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Verbal model
How does egg number depend on body mass M ?
eggN
Graphical model
Symbol Units Dimensions Scale
Dependent: kiloeggs # ratio
Explanatory: hectograms M ratio
eggN
M
![Page 9: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/9.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Verbal model
How does egg number depend on body mass M ?
eggN
Graphical model
Formal model (dependent vs. explanatory variables)
For population:
For sample:
MN Megg
eMbaN Megg
eMN Megg ˆˆ
DIMENSION for
:ˆM 1# M
![Page 10: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/10.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Place data in an appropriate format
Minitab: type in data OR copy & paste from Excel
R: two columns of data in Excel; save as .CSV (comma
delimited)
dat <- read.table(file.choose(), header = TRUE, sep = “,”)
![Page 11: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/11.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Place data in an appropriate format
Execute analysis in a statistical pkg: Minitab, R
Minitab:
MTB> regress ‘Neggs’ 1 ‘Mass’;
SUBC> fits c3;
SUBC> resi c4.
![Page 12: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/12.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Place data in an appropriate format
Execute analysis in a statistical pkg: Minitab, R
Minitab:
R: mdl <- lm(Neggs ~ Mass, data = dat)
summary(mdl)
mdl$res
mdl$fitted
![Page 13: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/13.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Place data in an appropriate format
Execute analysis in a statistical pkg: Minitab, R
Output: par estimates, fitted values, residuals
77.19ˆ 87.1ˆ M MN Megg ˆˆˆ
eggegg NN ˆ
![Page 14: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/14.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
-- res vs. fitted plot (Ch 9.3, pg 5: Fig)
-- No arches & no bowls
-- Linear vs. non-linear
(√)
![Page 15: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/15.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
-- res vs. fitted plot (Ch 9.3, pg 5: Fig)
-- Acceptable (~ uniform) band; no
cone
(√)
(√)
![Page 16: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/16.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
If n (=11 < 30) small, assumptions
met?
(√)
(√)
![Page 17: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/17.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
If n small, assumptions met?
1) residuals homogeneous?
2) sum(residuals) = 0? (least squares)
(√)
(√)
(√)
(√)
![Page 18: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/18.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
If n small, assumptions met?
1) residuals homogeneous?
2) sum(residuals) = 0? (least squares)
3) residuals independent?
(Pg 6-Fig; res vs. neighbours plot; no trends up or
down)
(√)
(√)
(√)
(√)
(√)
![Page 19: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/19.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
If n small, assumptions met?
1) residuals homogeneous?
2) sum(residuals) = 0? (least squares)
3) residuals independent?
4) residuals normal?
- Histogram (symmetrically distributed around
zero?)
(Pg 6: low panel graph) (NO)
- Residuals vs. normal scores plot (straight line?)
(Pg 7: graph) (NO)
(√)
(√)
(√)
(√)
(√)
(×)
![Page 20: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/20.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
(Residuals)
Straight line assumption
Homogeneous residuals?
If n small, assumptions met?
4) residuals normal? NO
(√)
(√)
![Page 21: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/21.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
State population; is sample representative?
All measurements that could have been
made by the same experimental
protocol1). Randomly sampled
2). Same environmental
conditions
3). Within the size range?
![Page 22: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/22.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
State population; is sample representative?
Hypothesis testing?
Research question: - NOT: whether there is a relation
- BUT: what the relation is? 1:1? 2:1? or ?
Parameters & confidence limit
![Page 23: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/23.jpg)
General Linear Model (GLM) --- Generic
Recipe Construct model
Execute model
Evaluate model
State population; is sample representative?
Hypothesis testing?
Parameters & confidence
limit
No
Deviation from normal was small Homogeneous residuals –
CI via randomization ~those from t-distribution
![Page 24: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/24.jpg)
General Linear Model (GLM) --- Generic
Recipe Parameters & confidence
limit Probability statement (tolerance of Type I error @
5%)
%51}ˆˆ{ ˆ]2[2/05.0ˆ]2[2/05.0 MMststP nMnM
Variance of :ˆM
3325.01106.0,1106.0)(
ˆ2
1
ˆ2
2
2ˆ
MMs
MMn
s
ii
ii
Confidence limit (do NOT forget UNITS)
-1hectogram · kiloeggs 1.12 325 2.2622·0.3– 1.87 L -1hectogram · kiloeggs 2.62 325 2.2622·0.3 1.87 U
![Page 25: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/25.jpg)
General Linear Model (GLM) --- Generic
Recipe Parameters & confidence
limit Interpretation of confidence
limit Confidence limit [1.12, 2.62] has 95 percent of chance to cover
the true slope M
Biological meaning
1). Strictly positive: larger fish, more eggs
2). CI beyond 1: > 1:1 ratio
;hectogram · kiloeggs 1.87ˆ -1M
![Page 26: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/26.jpg)
General Linear Model (GLM) --- Generic
Recipe Parameters & confidence
limit Consideration of downward bias (due to measurement error in explanatory variable)
** MM
*22*
*
/,
,&
MMMM kyreliabilitk
thenddistributetlyindependennormallyif
**222, MMwhere
0 < k < 1; the closer k to 1, the smaller the bias
![Page 27: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/27.jpg)
General Linear Model (GLM) --- Generic
Recipe Parameters & confidence
limit Consideration of downward bias (due to measurement error in explanatory variable)
For the current example:
k > 92.25/93.25 = 0.989 (very close to 1; bias is small)
0 < k < 1; the closer k to 1, the smaller the bias
1*2
25.93*2 M
25.922 M
![Page 28: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/28.jpg)
General Linear Model (GLM) --- Generic
Recipe Parameters & confidence
limit Report conclusions about parameters
1). Egg # increases with body size (Large fish produce more eggs
than small fish)
MNegg 87.177.19
2). With a ratio of > 1 : 1
-- 95% confidence interval for the slope estimate is 1.12-2.62
kiloeggs/hectogram, which excludes 1:1 relation
187.1ˆ, MestimateSlope
![Page 29: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/29.jpg)
General Linear Model (GLM)
Today – Another example of GLM
regression
Ch 9.3 Explanatory Variable Measured with
Error (fish size)
Ch 9.4 Exponential Regression (fish size)
![Page 30: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/30.jpg)
Regression--- Application to exponential
functionsExponential rates common in biology
1). Exponential population growth:
r – the intrinsic rate of population increase
2). Exponential growth of body mass:
k – exponential growth rate
rteNN 0)( 1time
kteMM 0
)( 1day
![Page 31: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/31.jpg)
Regression--- Application to exponential
functions Same recipe as in (GLM) regression analysis
Only thing extra: linearize the exponential model
kteMM 0Exponential model:
Linearized model: tkMMe )/(log 0
Response variable - , ratio of final to initial on a log-
scale
Explanatory variable - t, time in days from initial to recapture
)/(log 0MMe
![Page 32: BIOL 4605/7220](https://reader036.fdocuments.in/reader036/viewer/2022062315/56815753550346895dc4f905/html5/thumbnails/32.jpg)
Regression--- Application to exponential
functions
Formal model
For population:
For sample:
tkMMe )/(log 0
etkMMe ˆˆ)/(log 0