Please explain the influence of precipitation, altitude, age and geology parameters on the presence-absence of Faramea occidentalis species.. Analysis an influence of age category on the
Trang 1HANOI UNIVERSITY OF SCIENCE
Final exam scientific report
Course V370: Research Methods and Statistical Modelings
Vu Tuan Tai- K55TT KHMT- 10000792
" Analysis of presence or absence of species.
The data to be analyzed is the data on the abundance of Faramea occidentalis (in attached text file) Please explain the influence of precipitation, altitude, age and geology parameters on the presence-absence of Faramea occidentalis species The calculation and the numerical results are required "
Trang 21 Analysis an influence of age category on the presence-absence of Faramea occidentalis 2
1.1 Analysis by using quasi-binomial GLM 2
1.2 Graphical results 3
1.3 Discussion 4
2 Analysis an influence of precipitation on the presence-absence of Faramea occidentalis 4
2.2 Analysis by using quasi-binomial GLM 4
2.2 Graphical results 6
2.3 Discussion 7
3 Analysis an influence of elevation (altitude) on the presence-absence of Faramea occidentalis 7
3.1 Analysis by using quasi-binomial GLM 7
3.2 Graphical results 10
3.3 Discussion 11
4 Analysis an influence of geology on the presence-absence of Faramea occidentalis 11
4.1 Analysis by using quasi-binomial GLM 11
4.2 Graphical results 13
4.3 Discussion 13
5 Analysis the influence of several explanatory variables on the presence-absence of Faramea occidentalis by using binomial GLM 14
5.1 Results 14
5.2 Discussion 15
Conclusion 15
Trang 31 Analysis an influence of age category on the presence-absence of Faramea occidentalis
1.1 Analysis by using quasi-binomial GLM
> Presabs.model3 <- glm(formula = Faramea.occidentalis>0 ~ Age.cat, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> summary(Presabs.model3)
Call:
glm(formula = Faramea.occidentalis > 0 ~ Age.cat, family = quasibinomial(link = logit),
data = faramea, na.action = na.exclude)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.4350 -1.0008 -0.9005 1.0979 1.4823
Coefficients:
Estimate Std Error t value Pr(>|t|)
(Intercept) 0.5878 0.5783 1.016 0.316
Age.cat[T.c2] -0.7701 0.8536 -0.902 0.372
Age.cat[T.c3] -1.2809 0.7767 -1.649 0.107
(Dispersion parameter for quasibinomial family taken to be 1.075)
Null deviance: 59.401 on 42 degrees of freedom
Residual deviance: 56.322 on 40 degrees of freedom
(2 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 4
> anova(Presabs.model3,test="F")
Analysis of Deviance Table
Model: quasibinomial, link: logit
Response: Faramea.occidentalis > 0
Terms added sequentially (first to last)
Df Deviance Resid Df Resid Dev F Pr(>F)
NULL 42 59.401
Age.cat 2 3.0793 40 56.322 1.4322 0.2508
> predict(Presabs.model3, type="response", se.fit=T)
$fit
B0 B49 p1 p2 p3 p4 p5 p6
0.3333333 0.3333333 0.4545455 0.3333333 0.6428571 0.6428571 0.4545455 0.4545455
p7 p8 p9 p10 p11 p12 p13 p14
0.6428571 0.3333333 0.3333333 0.3333333 0.3333333 0.4545455 0.4545455 0.3333333
p15 p16 p17 p18 p19 p20 p21 p22
0.3333333 0.3333333 0.3333333 0.4545455 0.6428571 0.6428571 0.6428571 0.6428571
p23 p24 p25 p26 p27 p28 p29 p30
0.4545455 0.4545455 0.4545455 0.4545455 0.6428571 0.6428571 0.6428571 0.6428571
p31 p32 p33 p34 p35 p36 p37 p38
0.3333333 0.3333333 0.3333333 0.3333333 0.3333333 0.3333333 0.3333333 0.6428571
p39 p40 p41 C1 S0
0.6428571 NA NA 0.6428571 0.4545455
$se.fit
B0 B49 p1 p2 p3 p4 p5 p6
0.1152024 0.1152024 0.1556596 0.1152024 0.1327757 0.1327757 0.1556596 0.1556596
p7 p8 p9 p10 p11 p12 p13 p14
0.1327757 0.1152024 0.1152024 0.1152024 0.1152024 0.1556596 0.1556596 0.1152024
Trang 4p15 p16 p17 p18 p19 p20 p21 p22
0.1152024 0.1152024 0.1152024 0.1556596 0.1327757 0.1327757 0.1327757 0.1327757
p23 p24 p25 p26 p27 p28 p29 p30
0.1556596 0.1556596 0.1556596 0.1556596 0.1327757 0.1327757 0.1327757 0.1327757
p31 p32 p33 p34 p35 p36 p37 p38
0.1152024 0.1152024 0.1152024 0.1152024 0.1152024 0.1152024 0.1152024 0.1327757
p39 p40 p41 C1 S0
0.1327757 NA NA 0.1327757 0.1556596
$residual.scale
[1] 1.036822
> null.model <- glm(formula = Faramea.occidentalis>0 ~ 1, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> anova(null.model, Presabs.model3, test="Chi")
> plot(Presabs.model3)
> termplot(Presabs.model3, se=T, partial.resid=T, rug=T, terms="Age.cat")
> library(effects)
> plot(effect("Age.cat", Presabs.model3))
1.2 Graphical results
Trang 51.3 Discussion
We can see that the quasi-binomial model estimated the dispersion parameter to be 1.075
Moreover, the ANOVA table provides a large significant level P=0.25 The ANOVA table also provides important information on the deviance that is explained: the model only explains 3.079 per 59.401
of null deviance ( approximately 5.2%- small percentage) So that we can conclude there is no
evidence for an influence of age on the presence-absence of Faramea occidentalis.
2 Analysis an influence of precipitation on the presence-absence of Faramea occidentalis
2.2 Analysis by using quasi-binomial GLM
> Presabs.model4 <- glm(formula = Faramea.occidentalis>0 ~ Precipitation, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> summary(Presabs.model4)
Call:
glm(formula = Faramea.occidentalis > 0 ~ Precipitation, family = quasibinomial(link = logit),
data = faramea, na.action = na.exclude)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7303 -1.0431 -0.3289 1.1157 1.7268
Coefficients:
Estimate Std Error t value Pr(>|t|)
(Intercept) 6.948352 2.828385 2.457 0.0183 *
Trang 6Precipitation -0.002721 0.001095 -2.484 0.0172 *
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for quasibinomial family taken to be 0.9878704)
Null deviance: 59.401 on 42 degrees of freedom
Residual deviance: 50.561 on 41 degrees of freedom
(2 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 4
> summary(Presabs.model4)
Call:
glm(formula = Faramea.occidentalis > 0 ~ Precipitation, family = quasibinomial(link = logit), data = faramea, na.action = na.exclude)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7303 -1.0431 -0.3289 1.1157 1.7268
Coefficients:
Estimate Std Error t value Pr(>|t|)
(Intercept) 6.948352 2.828385 2.457 0.0183 *
Precipitation -0.002721 0.001095 -2.484 0.0172 *
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for quasibinomial family taken to be 0.9878704)
Null deviance: 59.401 on 42 degrees of freedom
Residual deviance: 50.561 on 41 degrees of freedom
(2 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 4
> anova(Presabs.model4,test="F")
Analysis of Deviance Table
Model: quasibinomial, link: logit
Response: Faramea.occidentalis > 0
Terms added sequentially (first to last)
Df Deviance Resid Df Resid Dev F Pr(>F)
NULL 42 59.401
Precipitation 1 8.8406 41 50.561 8.9492 0.004682 **
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> predict(Presabs.model4, type="response", se.fit=T)
$fit
B0 B49 p1 p2 p3 p4 p5
0.51585260 0.51585260 0.23199505 0.19599449 0.22518137 0.22881035 0.59346000 p6 p7 p8 p9 p10 p11 p12
0.60691110 0.57754510 0.56615226 0.28611341 0.51632834 0.52570000 0.53836922 p13 p14 p15 p16 p17 p18 p19
0.48436383 0.51265767 0.56648644 0.53498590 0.55603305 0.52888801 0.40957580 p20 p21 p22 p23 p24 p25 p26
0.42958718 0.59536260 0.52692120 0.69682041 0.67793630 0.64473891 0.69428486 p27 p28 p29 p30 p31 p32 p33
0.66272350 0.66962240 0.83081979 0.77620128 0.11822036 0.11782378 0.05264970 p34 p35 p36 p37 p38 p39 p40
0.18149948 0.01904871 0.21490787 0.17079990 0.52441063 0.60248775 NA p41 C1 S0
NA 0.85958830 0.21628851
Trang 7B0 B49 p1 p2 p3 p4 p5
0.08456340 0.08456340 0.10310235 0.10255668 0.10318186 0.10314912 0.09028002
p6 p7 p8 p9 p10 p11 p12
0.09175142 0.08867379 0.08763705 0.10019974 0.08457920 0.08494578 0.08560342
p13 p14 p15 p16 p17 p18 p19
0.08413929 0.08446438 0.08766594 0.08541010 0.08680929 0.08509405 0.08779233
p20 p21 p22 p23 p24 p25 p26
0.08625142 0.09048256 0.08500118 0.10200951 0.10003257 0.09618903 0.10175731
p27 p28 p29 p30 p31 p32 p33
0.09830953 0.09910199 0.10311570 0.10641589 0.09025501 0.09013959 0.05987074
p34 p35 p36 p37 p38 p39 p40
0.10157356 0.03010363 0.10314943 0.10051629 0.08488917 0.09125797 NA
p41 C1 S0
NA 0.09818365 0.10316496
$residual.scale
[1] 0.9939167
> null.model <- glm(formula = Faramea.occidentalis>0 ~ 1, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> anova(null.model, Presabs.model4, test="Chi")
Error in anova.glmlist(c(list(object), dotargs), dispersion = dispersion, :
models were not all fitted to the same size of dataset
> plot(Presabs.model4)
Waiting to confirm page change
Waiting to confirm page change
Waiting to confirm page change
Waiting to confirm page change
> termplot(Presabs.model4, se=T, partial.resid=T, rug=T, terms="Precipitation")
> library(effects)
> plot(effect("Precipitation", Presabs.model4))
>
2.2 Graphical results
Trang 82.3 Discussion
From the result above, we can see that the dispersion parameter is estimated to be 0.987, very close
to 1 In addition, we can obtain that there is evidence that precipitation has an effect on the
presence-absence of Faramea, because the significant level calculated for the coefficient is low (P=0.0172) and the model can explain 8.84 per 59.401 of null deviance We can also notice that there is an effect of precipitation from the low significance level of the ANOVA table (P=0.005).
Here we need to calculate the inverse logit function y= exp(x)/(1+exp(x))
Where: x= intercept
So the value of y= exp(6.9483)/(1 + exp(6.9483-0.00272))= 1.0017
3 Analysis an influence of elevation (altitude) on the
presence-absence of Faramea occidentalis
3.1 Analysis by using quasi-binomial GLM
> Presabs.model4 <- glm(formula = Faramea.occidentalis>0 ~ Elevation, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> summary(Presabs.model4)
Trang 9glm(formula = Faramea.occidentalis > 0 ~ Elevation, family = quasibinomial(link = logit), data = faramea, na.action = na.exclude)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5768 -1.0960 -0.1003 0.9853 1.3298
Coefficients:
Estimate Std Error t value Pr(>|t|)
(Intercept) 1.059522 0.548718 1.931 0.0604
Elevation -0.007838 0.003608 -2.172 0.0357 *
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for quasibinomial family taken to be 0.9235897)
Null deviance: 59.401 on 42 degrees of freedom
Residual deviance: 49.469 on 41 degrees of freedom
(2 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 5
> summary(Presabs.model4)
Call:
glm(formula = Faramea.occidentalis > 0 ~ Elevation, family = quasibinomial(link = logit), data = faramea, na.action = na.exclude)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5768 -1.0960 -0.1003 0.9853 1.3298
Coefficients:
Estimate Std Error t value Pr(>|t|)
(Intercept) 1.059522 0.548718 1.931 0.0604
Elevation -0.007838 0.003608 -2.172 0.0357 *
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for quasibinomial family taken to be 0.9235897)
Null deviance: 59.401 on 42 degrees of freedom
Residual deviance: 49.469 on 41 degrees of freedom
(2 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 5
> anova(Presabs.model4,test="F")
Analysis of Deviance Table
Model: quasibinomial, link: logit
Response: Faramea.occidentalis > 0
Terms added sequentially (first to last)
Df Deviance Resid Df Resid Dev F Pr(>F)
NULL 42 59.401
Elevation 1 9.9317 41 49.469 10.753 0.002127 **
-Signif codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> predict(Presabs.model4, type="response", se.fit=T)
$fit
B0 B49 p1 p2 p3 p4
Trang 100.529708571 0.529708571 0.711517145 0.568499634 0.413067396 0.413067396
p5 p6 p7 p8 p9 p10
0.678307798 0.695166342 0.643192603 0.660971608 0.103956639 0.587614191
p11 p12 p13 p14 p15 p16
0.643192603 0.727334914 0.652135099 0.643192603 0.625010199 0.451517474
p17 p18 p19 p20 p21 p22
0.529708571 0.646782001 0.451517474 0.451517474 0.549178826 0.413067396
p23 p24 p25 p26 p27 p28
0.695166342 0.660971608 0.549178826 0.660971608 0.413067396 0.451517474
p29 p30 p31 p32 p33 p34
0.568499634 0.413067396 0.163984396 0.143608856 0.025500776 0.357453005
p35 p36 p37 p38 p39 p40
0.004295295 0.375649093 0.025500776 0.005020600 0.016087593 NA
p41 C1 S0
NA 0.660971608 0.490555259
$se.fit
B0 B49 p1 p2 p3 p4 p5
0.08146756 0.08146756 0.10112096 0.08255982 0.09403845 0.09403845 0.09628896
p6 p7 p8 p9 p10 p11 p12
0.09880798 0.09097973 0.09364622 0.10141856 0.08406130 0.09097973 0.10316293
p13 p14 p15 p16 p17 p18 p19
0.09230903 0.09097973 0.08840591 0.08774458 0.08146756 0.09150956 0.08774458
p20 p21 p22 p23 p24 p25 p26
0.08774458 0.08166658 0.09403845 0.09880798 0.09364622 0.08166658 0.09364622
p27 p28 p29 p30 p31 p32 p33
0.09403845 0.08774458 0.08255982 0.09403845 0.11807371 0.11418257 0.04360614
p34 p35 p36 p37 p38 p39 p40
0.10458585 0.01101142 0.10109007 0.04360614 0.01250399 0.03114841 NA
p41 C1 S0
NA 0.09364622 0.08327455
$residual.scale
[1] 0.9610358
> null.model <- glm(formula = Faramea.occidentalis>0 ~ 1, family = quasibinomial(link=logit) , data = faramea, na.action = na.exclude)
> anova(null.model, Presabs.model4, test="Chi")
> plot(Presabs.model4)
> termplot(Presabs.model4, se=T, partial.resid=T, rug=T, terms="Elevation")
> library(effects)
> plot(effect("Elevation", Presabs.model4))