Skip to content
Snippets Groups Projects
Commit fe429e4e authored by Loïc Lehnhoff's avatar Loïc Lehnhoff
Browse files

Update .gitignore and stats_Buzz_Burst-pulse.R :

- updated result prints for BBP models
- removed over-complicated burst-pulse modelisation
parent b54c8fe0
No related branches found
No related tags found
No related merge requests found
*.sav
*.Rhistory
*.RData
\ No newline at end of file
**/.Rhistory
**/.RData
\ No newline at end of file
......@@ -133,6 +133,7 @@ ftable(factor(bbp.dta$fishing_net), factor(bbp.dta$behavior), factor(bbp.dta$aco
mod.bbp <- glm.nb(number_of_BBP ~ acoustic + fishing_net + behavior
+ offset(log(number)),
data=bbp.dta)
summary(mod.bbp)
car::Anova(mod.bbp, type=3)
dwtest(mod.bbp) # H0 -> independent if p>0.05 (autocorrelation if p<0.05)
bptest(mod.bbp) # H0 -> homoscedasticity if p<0.05
......@@ -143,11 +144,11 @@ mod.bbp$deviance/mod.bbp$df.residual
### Model for Buzzes
# No normality of residuals for LM
# overdispersion with GLM quasipoisson
# underdispersion with glm NB
# Try with ZINB:
# Try with glm NB
mod.buzz <- glm.nb(Buzz ~ behavior + fishing_net + acoustic
+ offset(log(number)),
data=bbp.dta)
summary(mod.buzz)
car::Anova(mod.buzz, type=3)
dwtest(mod.buzz) # H0 -> independent if p>0.05 (autocorrelation if p<0.05)
bptest(mod.buzz) # H0 -> homoscedasticity if p<0.05
......@@ -157,20 +158,19 @@ mod.buzz$df.null/mod.buzz$df.residual
### Model for Burst-pulses
# No normality of residuals for LM
# overdispersion with quasipoisson
# underdispersion with NB
# ZINB is working :
mod.burst.pulse <- zeroinfl(Burst.pulse ~ fishing_net + acoustic + behavior
+ offset(log(number)), dist="negbin",
# Try with glm NB
mod.burst.pulse <- glm.nb(Burst.pulse ~ fishing_net + acoustic + behavior
+ offset(log(number)),
data=bbp.dta)
summary(mod.burst.pulse)
car::Anova(mod.burst.pulse, type=3)
dwtest(mod.burst.pulse) # H0 -> independent if p>0.05 (autocorrelation if p<0.05)
bptest(mod.burst.pulse) # H0 -> homoscedasticity if p<0.05
mod.burst.pulse$df.null/mod.burst.pulse$df.residual # -> Overdispersion of != 1
# no overdispersion
##################### Boxplots and comparisons #####################
### Functions to compute stats
### Functions to compute stats ###----
computeLetters <- function(temp, category) {
test <- multcomp::cld(object = temp$emmeans,
Letters = letters)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment