#On vide les variables préexistantes
rm(list=ls())
#Je désigne le répertoire de mon fichier Rmd comme étant le répertoire de travail
setwd(".")
liaisons <- dbConnect(odbc::odbc(), .connection_string = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=./CAMPAGNE_PRESH_NORD_SUD_2012_2015.accdb")
#Passer une requete
head(dbGetQuery(liaisons ,"select * from projet"))
## code_pays code_projet
## 1 BN PRESH-ZS-DM
## 2 BN PRESH-ZS-PEL
## 3 CI PRESH-ZS-DM
## 4 CI PRESH-ZS-PEL
## 5 GH PRESH-ZS-DM
## 6 GH PRESH-ZS-PEL
## nom_project
## 1 Evaluation des stocks d<e9>mersaux
## 2 Projet d'Evaluation des Stocks Halieutiques (P<e9>lagiques) ZONE SUD
## 3 Evaluation des stocks d<e9>mersaux
## 4 Projet d'Evaluation des Stocks Halieutiques (P<e9>lagiques) ZONE SUD
## 5 Evaluation des stocks d<e9>mersaux
## 6 Projet d'Evaluation des Stocks Halieutiques (P<e9>lagiques) ZONE SUD
## adresse_projet maitre_oeuvre couverture_geo
## 1 UEMOA UEMOA ZEE BENIN
## 2 UEMOA UEMOA ZEE-Cote d'Ivoire
## 3 UEMOA UEMOA ZEE COTE D'IVOIRE
## 4 UEMOA UEMOA ZEE-Cote d'Ivoire
## 5 UEMOA UEMOA ZEE GHANA
## 6 UEMOA UEMOA ZEE-Cote d'Ivoire
## objectifs institutions
## 1 Evaluation des stocks d<e9>mersaux de la zone sud du PRESH CNSHB
## 2 Evaluation des stocks p<e9>lagiques de la zone sud du PRESH CROD
## 3 Evaluation des stocks d<e9>mersaux de la zone sud du PRESH CNSHB
## 4 Evaluation des stocks p<e9>lagiques de la zone sud du PRESH CROD
## 5 Evaluation des stocks d<e9>mersaux de la zone sud du PRESH CNSHB
## 6 Evaluation des stocks p<e9>lagiques de la zone sud du PRESH CROD
## model reference remarque
## 1 <NA> <NA> <NA>
## 2 <NA> <NA> <NA>
## 3 <NA> <NA> <NA>
## 4 <NA> <NA> <NA>
## 5 <NA> <NA> <NA>
## 6 <NA> <NA> <NA>
stations<-dbGetQuery(liaisons,"select distinct A.code_pays,A.code_campagne as cruise_number,A.code_station as station_code,month(Date) as mois,
year(Date) as an
,
replace(longitude_deb,',','.') as longitude,
replace(latitude_deb,',','.') as latitude,
profond_deb as bathy,
strate as zone
from station A inner join capture B on (A.code_pays=B.code_pays and A.code_projet=B.code_projet and A.code_campagne=B.code_campagne and A.code_station=B.code_station)
")
captures<-dbGetQuery(liaisons ,"select A.code_pays,A.code_campagne as cruise_number,
A.code_station as station_code,ucase(nom_taxonomique) as taxonomic_name,sum(total_capture) as ptstd,sum(nombre) as nbstd
from station A
left join capture B on (A.code_pays=B.code_pays and A.code_projet=B.code_projet and A.code_campagne=B.code_campagne and A.code_station=B.code_station)
where ucase(nom_taxonomique) like 'PENAEUS NOTIALIS'
group by A.code_pays,A.code_campagne, A.code_station,ucase(nom_taxonomique)")
kable(head(captures))
code_pays | cruise_number | station_code | taxonomic_name | ptstd | nbstd |
---|---|---|---|---|---|
BN | UEMOA0312PEL | 34 | PENAEUS NOTIALIS | 11.60 | 522 |
BN | UEMOA0315DM | 10 | PENAEUS NOTIALIS | 0.05 | 2 |
BN | UEMOA0315DM | 14 | PENAEUS NOTIALIS | 0.10 | 6 |
BN | UEMOA0315DM | 16 | PENAEUS NOTIALIS | 0.01 | 2 |
CI | UEMOA0312PEL | 2 | PENAEUS NOTIALIS | 9.60 | 60 |
CI | UEMOA0312PEL | 4 | PENAEUS NOTIALIS | 0.60 | 2 |
kable(head(stations))
code_pays | cruise_number | station_code | mois | an | longitude | latitude | bathy | zone |
---|---|---|---|---|---|---|---|---|
BN | UEMOA0312PEL | 30 | 3 | 2012 | 1.46 | 6.12 | 25 | 010-050m |
BN | UEMOA0312PEL | 31 | 3 | 2012 | 1.46 | 6.11 | 25 | 010-050m |
BN | UEMOA0312PEL | 32 | 3 | 2012 | 2.04 | 6.07 | 72 | 051-100m |
BN | UEMOA0312PEL | 33 | 3 | 2012 | 2.02 | 6.12 | 27 | 010-050m |
BN | UEMOA0312PEL | 34 | 3 | 2012 | 2.15 | 6.1 | 50 | 010-050m |
BN | UEMOA0312PEL | 35 | 3 | 2012 | 2.33 | 6.08 | 65 | 051-100m |
Nous utilisons la fonction left_join qui fait une jointure à gauche. C’est a dire qu’elle garde l’ensemble de la table de gauche (les stations) et complète par la table de droite (captures) si il y a correspondance. Si il n’y a pas de correspondance, les champs de captures sont mis à NA
#install.packages("dplyr")
tableau_glm<-left_join(stations,captures,by=c("code_pays","cruise_number","station_code"))
Une fois que j’ai ce tableau je peux y rajouter 2 colonnes calculées : La colonne présence qui est à 1 si dans la colonne non taxonomique il n’y a pas de NA (Donc si j’y trouve le nom de l’espèce) et à 0 sinon La colonne des saisons mise à partir d’une table de référence mois/saison qui assigne aux 12 mois une saison
tableau_glm$presence<-as.numeric(!is.na(tableau_glm$taxonomic_name))
tab_saisons<-data.frame(
mois=as.numeric(c(1,2,3,4,5,6,7,8,9,10,11,12)),
saisons=c("S1","S1","S1","S2","S2","S2","S3","S3","S3","S3","S3","S3")
)
tableau_glm<-inner_join(tableau_glm,tab_saisons,by=c("mois"))
kable(head(tableau_glm))
code_pays | cruise_number | station_code | mois | an | longitude | latitude | bathy | zone | taxonomic_name | ptstd | nbstd | presence | saisons |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BN | UEMOA0312PEL | 30 | 3 | 2012 | 1.46 | 6.12 | 25 | 010-050m | NA | NA | NA | 0 | S1 |
BN | UEMOA0312PEL | 31 | 3 | 2012 | 1.46 | 6.11 | 25 | 010-050m | NA | NA | NA | 0 | S1 |
BN | UEMOA0312PEL | 32 | 3 | 2012 | 2.04 | 6.07 | 72 | 051-100m | NA | NA | NA | 0 | S1 |
BN | UEMOA0312PEL | 33 | 3 | 2012 | 2.02 | 6.12 | 27 | 010-050m | NA | NA | NA | 0 | S1 |
BN | UEMOA0312PEL | 34 | 3 | 2012 | 2.15 | 6.1 | 50 | 010-050m | PENAEUS NOTIALIS | 11.6 | 522 | 1 | S1 |
BN | UEMOA0312PEL | 35 | 3 | 2012 | 2.33 | 6.08 | 65 | 051-100m | NA | NA | NA | 0 | S1 |
plot(tableau_glm$longitude,tableau_glm$latitude,cex=0.1)
points(tableau_glm[tableau_glm$presence==1,]$longitude,tableau_glm[tableau_glm$presence==1,]$latitude,cex=tableau_glm$ptstd,col='red')
Dans un premier temps le modèle de présence absence
library(lattice)
library(stats4)
library(MASS)
tableau_glm$code_pays=factor(tableau_glm$code_pays)
tableau_glm$an=factor(tableau_glm$an)
tableau_glm$mois=factor(tableau_glm$mois)
tableau_glm$zone=factor(tableau_glm$zone)
tableau_glm$bathy = factor(tableau_glm$bathy)
tableau_glm$saisons = factor(tableau_glm$saisons )
tableau_glm$presence= factor(tableau_glm$presence)
# download the lattice Package (to improve graphics)
SModel1<-glm(presence ~ code_pays + saisons + zone + bathy ,family=binomial,data=tableau_glm)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
anova(SModel1,test="Chisq")
## Analysis of Deviance Table
##
## Model: binomial, link: logit
##
## Response: presence
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 403 233.358
## code_pays 8 18.842 395 214.516 0.01573 *
## saisons 1 0.865 394 213.651 0.35239
## zone 22 56.990 372 156.661 6.159e-05 ***
## bathy 156 144.525 216 12.137 0.73510
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(SModel1)
##
## Call:
## glm(formula = presence ~ code_pays + saisons + zone + bathy,
## family = binomial, data = tableau_glm)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.482 0.000 0.000 0.000 1.177
##
## Coefficients: (2 not defined because of singularities)
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -5.926e+01 3.363e+05 0.000 1.000
## code_paysCI 8.214e+01 3.306e+04 0.002 0.998
## code_paysGH 4.057e+01 1.678e+04 0.002 0.998
## code_paysGIN -1.391e+00 2.283e+04 0.000 1.000
## code_paysGMB -6.558e+01 2.443e+05 0.000 1.000
## code_paysGNB -2.002e+00 2.842e+04 0.000 1.000
## code_paysMRT -1.098e+02 7.596e+04 -0.001 0.999
## code_paysSEN -1.182e+02 3.892e+05 0.000 1.000
## code_paysTG 4.496e+01 6.476e+04 0.001 0.999
## saisonsS2 5.243e+01 3.361e+05 0.000 1.000
## zone010-050m -4.845e+01 2.548e+05 0.000 1.000
## zone021-040m -8.562e+01 4.949e+04 -0.002 0.999
## zone051-100m -1.063e+01 2.887e+05 0.000 1.000
## zone10-25m -1.070e+02 5.288e+04 -0.002 0.998
## zone10-25m_ZC 5.162e+01 3.961e+05 0.000 1.000
## zone10-25m_ZN 5.083e+01 3.438e+05 0.000 1.000
## zone10-25m_ZS -9.957e-01 8.130e+04 0.000 1.000
## zone101-200m 9.797e+01 4.458e+05 0.000 1.000
## zone25-50m -1.823e+02 3.049e+05 -0.001 1.000
## zone25-50m_ZC 4.006e+00 4.155e+05 0.000 1.000
## zone25-50m_ZN 5.480e+01 3.112e+05 0.000 1.000
## zone25-50m_ZS 3.930e+00 4.160e+05 0.000 1.000
## zone50-100m -1.605e+02 3.190e+05 -0.001 1.000
## zone50-100m_ZC 2.435e-01 1.525e+05 0.000 1.000
## zone50-100m_ZN 4.448e+01 2.912e+05 0.000 1.000
## zone50-100m_ZS -1.291e+01 4.159e+05 0.000 1.000
## zoneC010-020m 6.579e+01 6.284e+04 0.001 0.999
## zoneC010-050m 5.197e+01 3.841e+05 0.000 1.000
## zoneC021-080m 1.345e+02 3.072e+05 0.000 1.000
## zoneC051-100m 1.877e+02 3.110e+05 0.001 1.000
## zoneN010-020m 2.066e+01 8.891e+04 0.000 1.000
## zoneN021-080m 1.900e+01 1.647e+05 0.000 1.000
## zoneS021-080m NA NA NA NA
## bathy9 4.834e+01 4.001e+05 0.000 1.000
## bathy10 4.760e+01 4.262e+05 0.000 1.000
## bathy11 4.063e+01 4.745e+07 0.000 1.000
## bathy11.8 8.825e+01 4.298e+05 0.000 1.000
## bathy12 2.954e+01 3.735e+05 0.000 1.000
## bathy12.1 4.768e+01 4.292e+05 0.000 1.000
## bathy12.4 8.825e+01 4.298e+05 0.000 1.000
## bathy13 2.625e+01 3.839e+05 0.000 1.000
## bathy13.9 5.853e+01 3.946e+05 0.000 1.000
## bathy14 8.914e+00 3.744e+05 0.000 1.000
## bathy14.1 9.133e+01 3.744e+05 0.000 1.000
## bathy15 -1.535e+01 3.828e+05 0.000 1.000
## bathy15.5 8.825e+01 4.298e+05 0.000 1.000
## bathy15.6 8.825e+01 4.298e+05 0.000 1.000
## bathy15.8 4.329e+01 4.346e+05 0.000 1.000
## bathy16 -1.512e+01 3.811e+05 0.000 1.000
## bathy16.5 4.329e+01 4.069e+05 0.000 1.000
## bathy17 -1.541e+01 3.833e+05 0.000 1.000
## bathy17.2 8.825e+01 4.298e+05 0.000 1.000
## bathy18 4.966e+01 3.963e+05 0.000 1.000
## bathy18.4 8.825e+01 4.298e+05 0.000 1.000
## bathy19 -1.414e+01 3.769e+05 0.000 1.000
## bathy19.2 4.768e+01 4.292e+05 0.000 1.000
## bathy19.6 8.825e+01 4.298e+05 0.000 1.000
## bathy20 7.270e+01 3.718e+05 0.000 1.000
## bathy20.4 4.864e+01 3.942e+05 0.000 1.000
## bathy20.9 5.853e+01 3.946e+05 0.000 1.000
## bathy21 4.489e+01 2.217e+05 0.000 1.000
## bathy21.4 4.329e+01 4.346e+05 0.000 1.000
## bathy22 9.384e+01 3.711e+05 0.000 1.000
## bathy22.2 4.768e+01 4.292e+05 0.000 1.000
## bathy22.6 6.107e+00 4.282e+05 0.000 1.000
## bathy23 4.466e+01 2.227e+05 0.000 1.000
## bathy23.9 4.768e+01 4.292e+05 0.000 1.000
## bathy24 4.889e+01 3.713e+05 0.000 1.000
## bathy24.01 5.724e+01 4.282e+05 0.000 1.000
## bathy25 7.324e+01 3.709e+05 0.000 1.000
## bathy25.5 1.196e+02 2.664e+05 0.000 1.000
## bathy26 9.384e+01 3.711e+05 0.000 1.000
## bathy27 8.278e+01 2.691e+05 0.000 1.000
## bathy27.9 1.326e+02 3.068e+05 0.000 1.000
## bathy28 6.989e+01 3.773e+05 0.000 1.000
## bathy28.03 8.142e+01 3.068e+05 0.000 1.000
## bathy29 4.364e+01 2.309e+05 0.000 1.000
## bathy30 3.930e+01 2.338e+05 0.000 1.000
## bathy31 6.924e+01 3.829e+05 0.000 1.000
## bathy31.3 1.230e+02 3.081e+05 0.000 1.000
## bathy32 6.888e+01 3.877e+05 0.000 1.000
## bathy32.2 1.230e+02 3.081e+05 0.000 1.000
## bathy33 1.650e+02 3.092e+05 0.001 1.000
## bathy33.3 1.230e+02 3.081e+05 0.000 1.000
## bathy34 2.898e+00 2.219e+05 0.000 1.000
## bathy34.4 1.326e+02 3.068e+05 0.000 1.000
## bathy34.7 1.230e+02 3.081e+05 0.000 1.000
## bathy35 4.390e+01 2.230e+05 0.000 1.000
## bathy35.7 1.186e+02 3.162e+05 0.000 1.000
## bathy35.9 1.230e+02 3.081e+05 0.000 1.000
## bathy36 4.974e+01 3.812e+05 0.000 1.000
## bathy36.3 1.850e+02 4.555e+05 0.000 1.000
## bathy36.8 1.850e+02 4.555e+05 0.000 1.000
## bathy37 4.959e+01 3.822e+05 0.000 1.000
## bathy37.2 1.741e+02 3.081e+05 0.001 1.000
## bathy37.7 1.230e+02 3.081e+05 0.000 1.000
## bathy38 4.402e+01 2.270e+05 0.000 1.000
## bathy38.6 1.636e+02 3.095e+05 0.001 1.000
## bathy39 9.780e+01 4.014e+05 0.000 1.000
## bathy39.5 1.741e+02 3.081e+05 0.001 1.000
## bathy40 4.662e+01 2.172e+05 0.000 1.000
## bathy40.3 1.230e+02 3.081e+05 0.000 1.000
## bathy40.7 1.326e+02 3.068e+05 0.000 1.000
## bathy41 4.037e+00 2.179e+05 0.000 1.000
## bathy41.1 2.147e+02 3.095e+05 0.001 0.999
## bathy41.6 8.142e+01 3.068e+05 0.000 1.000
## bathy42 7.399e+01 4.106e+05 0.000 1.000
## bathy42.6 1.850e+02 4.555e+05 0.000 1.000
## bathy42.9 1.230e+02 3.081e+05 0.000 1.000
## bathy43 3.868e+01 2.492e+05 0.000 1.000
## bathy43.3 1.230e+02 3.081e+05 0.000 1.000
## bathy43.4 1.186e+02 3.162e+05 0.000 1.000
## bathy44 1.725e+00 2.345e+05 0.000 1.000
## bathy45 8.991e+01 3.251e+05 0.000 1.000
## bathy45.2 1.186e+02 3.162e+05 0.000 1.000
## bathy45.9 1.230e+02 3.081e+05 0.000 1.000
## bathy46 1.654e+02 2.523e+05 0.001 0.999
## bathy47 7.088e+01 3.757e+05 0.000 1.000
## bathy47.5 1.230e+02 3.081e+05 0.000 1.000
## bathy48 8.702e+01 7.045e+05 0.000 1.000
## bathy49 2.110e+02 2.243e+05 0.001 0.999
## bathy50 1.281e+02 2.191e+05 0.001 1.000
## bathy50.01 8.142e+01 3.068e+05 0.000 1.000
## bathy50.3 1.012e+02 3.918e+05 0.000 1.000
## bathy51 -8.633e+01 2.444e+05 0.000 1.000
## bathy51.4 5.962e+01 3.908e+05 0.000 1.000
## bathy51.6 1.012e+02 3.918e+05 0.000 1.000
## bathy52 -8.516e+01 2.340e+05 0.000 1.000
## bathy52.02 1.012e+02 3.918e+05 0.000 1.000
## bathy52.3 1.120e+02 4.893e+05 0.000 1.000
## bathy53 -4.085e+01 2.283e+05 0.000 1.000
## bathy53.02 1.012e+02 3.918e+05 0.000 1.000
## bathy54 2.073e+02 3.133e+05 0.001 0.999
## bathy55 1.431e+02 3.245e+05 0.000 1.000
## bathy55.5 5.962e+01 3.908e+05 0.000 1.000
## bathy56 -4.155e+01 2.357e+05 0.000 1.000
## bathy57 -4.163e+01 2.368e+05 0.000 1.000
## bathy57.4 1.012e+02 3.918e+05 0.000 1.000
## bathy57.8 5.962e+01 3.908e+05 0.000 1.000
## bathy58 9.228e+01 3.989e+05 0.000 1.000
## bathy58.6 5.962e+01 3.908e+05 0.000 1.000
## bathy59 1.432e+02 3.921e+05 0.000 1.000
## bathy59.4 1.929e+02 3.927e+05 0.000 1.000
## bathy59.6 1.012e+02 3.918e+05 0.000 1.000
## bathy60 6.071e+00 2.616e+05 0.000 1.000
## bathy61 1.435e+02 3.593e+05 0.000 1.000
## bathy62 1.012e+02 3.918e+05 0.000 1.000
## bathy62.4 5.962e+01 3.908e+05 0.000 1.000
## bathy63 9.968e+01 3.858e+05 0.000 1.000
## bathy64 -8.820e+01 3.149e+05 0.000 1.000
## bathy65 4.547e+01 2.799e+05 0.000 1.000
## bathy66 1.027e+02 3.421e+05 0.000 1.000
## bathy66.3 1.120e+02 4.649e+05 0.000 1.000
## bathy68 9.965e+01 3.984e+05 0.000 1.000
## bathy68.5 5.962e+01 3.908e+05 0.000 1.000
## bathy68.6 1.418e+02 3.927e+05 0.000 1.000
## bathy68.8 5.962e+01 3.908e+05 0.000 1.000
## bathy69.2 1.418e+02 3.927e+05 0.000 1.000
## bathy69.3 1.012e+02 3.918e+05 0.000 1.000
## bathy69.5 1.120e+02 4.893e+05 0.000 1.000
## bathy70 7.203e+01 4.568e+05 0.000 1.000
## bathy70.2 1.012e+02 3.918e+05 0.000 1.000
## bathy70.7 1.120e+02 4.893e+05 0.000 1.000
## bathy72 -3.621e+01 2.721e+05 0.000 1.000
## bathy72.4 5.962e+01 3.908e+05 0.000 1.000
## bathy72.9 1.418e+02 3.927e+05 0.000 1.000
## bathy73 1.012e+02 3.918e+05 0.000 1.000
## bathy74.4 5.962e+01 3.908e+05 0.000 1.000
## bathy74.8 9.681e+01 3.980e+05 0.000 1.000
## bathy75 1.063e+02 4.618e+05 0.000 1.000
## bathy75.1 9.681e+01 3.980e+05 0.000 1.000
## bathy75.5 9.681e+01 3.980e+05 0.000 1.000
## bathy75.8 1.012e+02 3.918e+05 0.000 1.000
## bathy76.2 1.418e+02 3.927e+05 0.000 1.000
## bathy77 5.497e+01 5.425e+05 0.000 1.000
## bathy78 9.915e+01 3.971e+05 0.000 1.000
## bathy79 -3.782e+01 2.966e+05 0.000 1.000
## bathy80 -4.027e+01 2.250e+05 0.000 1.000
## bathy81 1.120e+02 4.893e+05 0.000 1.000
## bathy81.6 5.962e+01 3.908e+05 0.000 1.000
## bathy82.1 1.012e+02 3.918e+05 0.000 1.000
## bathy82.4 1.012e+02 3.918e+05 0.000 1.000
## bathy82.8 1.012e+02 3.918e+05 0.000 1.000
## bathy86 1.012e+02 3.918e+05 0.000 1.000
## bathy89 -4.230e+01 2.512e+05 0.000 1.000
## bathy92 1.039e+02 5.142e+05 0.000 1.000
## bathy95 -8.820e+01 3.149e+05 0.000 1.000
## bathy99 5.497e+01 5.425e+05 0.000 1.000
## bathy105 -5.113e+01 3.055e+05 0.000 1.000
## bathy110 NA NA NA NA
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 233.358 on 403 degrees of freedom
## Residual deviance: 12.137 on 216 degrees of freedom
## AIC: 388.14
##
## Number of Fisher Scoring iterations: 24
model1<-SModel1
res1 <- resid(SModel1)
fit1 <- fitted(SModel1)
par(mfrow = c(2,2))
hist(res1)
plot(fit1,res1)
qqnorm(res1)
qqline(res1)
Mainstenant le modèle 2 sur les données présentes
unique(tableau_glm$zone)
## [1] 010-050m 051-100m 10-25m 25-50m 50-100m 021-040m
## [7] 010-020m 101-200m 10-25m_ZN 25-50m_ZN 50-100m_ZN 10-25m_ZC
## [13] 25-50m_ZC 50-100m_ZC 50-100m_ZS 10-25m_ZS 25-50m_ZS N010-020m
## [19] N021-080m C010-020m C021-080m S021-080m C010-050m C051-100m
## 24 Levels: 010-020m 010-050m 021-040m 051-100m 10-25m 10-25m_ZC ... S021-080m
SModel2<-glm(log(ptstd)~ code_pays + saisons+ zone ,family=gaussian, data=tableau_glm[tableau_glm$presence==1,])
#ag = aggregate(SModel2$y, by = list(SModel2$coefficients))
anova(SModel2,test="Chisq")
## Analysis of Deviance Table
##
## Model: gaussian, link: identity
##
## Response: log(ptstd)
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 33 90.798
## code_pays 7 19.897 26 70.902 0.1568
## saisons 1 28.842 25 42.060 8.826e-05 ***
## zone 8 10.165 17 31.895 0.7121
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(SModel2)
##
## Call:
## glm(formula = log(ptstd) ~ code_pays + saisons + zone, family = gaussian,
## data = tableau_glm[tableau_glm$presence == 1, ])
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7363 -0.4500 0.0000 0.3324 2.4381
##
## Coefficients: (4 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.812e-01 1.725e+00 -0.163 0.8725
## code_paysCI 1.218e-01 9.663e-01 0.126 0.9012
## code_paysGH -6.389e-01 1.198e+00 -0.533 0.6008
## code_paysGIN -2.086e-01 1.479e+00 -0.141 0.8895
## code_paysGMB 4.055e-01 1.937e+00 0.209 0.8367
## code_paysMRT -2.368e-17 1.937e+00 0.000 1.0000
## code_paysSEN -6.931e-01 1.937e+00 -0.358 0.7249
## code_paysTG -2.970e-01 1.933e+00 -0.154 0.8797
## saisonsS2 -2.021e+00 1.049e+00 -1.927 0.0709 .
## zone010-050m 1.113e+00 1.858e+00 0.599 0.5572
## zone021-040m 6.141e-01 1.118e+00 0.549 0.5901
## zone051-100m -2.015e+00 1.937e+00 -1.040 0.3128
## zone10-25m -3.961e-01 1.933e+00 -0.205 0.8400
## zone101-200m NA NA NA NA
## zone25-50m -6.881e-01 1.611e+00 -0.427 0.6746
## zone50-100m NA NA NA NA
## zoneC010-020m -1.010e-02 1.678e+00 -0.006 0.9953
## zoneC010-050m 6.931e-01 1.937e+00 0.358 0.7249
## zoneC021-080m 1.504e+00 1.937e+00 0.776 0.4481
## zoneC051-100m NA NA NA NA
## zoneS021-080m NA NA NA NA
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 1.876185)
##
## Null deviance: 90.798 on 33 degrees of freedom
## Residual deviance: 31.895 on 17 degrees of freedom
## AIC: 130.31
##
## Number of Fisher Scoring iterations: 2