===================
La méthode Capture-Marquage-Recapture, abrégée CMR est utilisé pour estimer le taux de survie et de capture des populations étudiées.
#### Pour le formatage des données
#install.packages("tidyverse", dependencies = TRUE)
library(tidyverse)
## Warning: package 'ggplot2' was built under R version 4.3.2
#install.packages("tidyr")
library(tidyr)
#install.packages("dplyr")
library(dplyr)
#install.packages("xtable")
library(xtable)
#install.packages("RMark")
library(kableExtra)
#install.packages("webshot")
library(webshot)
# Install PhantomJS
#webshot::install_phantomjs()
#### Pour le formatage spécifique à RMarkdown
#install.packages("knitr")
library(knitr)
#### Pour la CMR
#install.packages("RMark")
library(RMark)
#install.packages("R2ucare")
library(R2ucare)
#### Pour les statistiques
#install.packages("rstatix")
library(rstatix)
#install.packages("car")
library(car)
#install.packages("rcompanion")
library(rcompanion)
#### Pour les représentation graphiques
#install.packages("ggplot2")
library(ggplot2)
#install.packages("ggpubr")
library(ggpubr)
#### Import
col1.2 <- import.chdata("/Users/Lj/Desktop/Master_EEE_S2/EFE - Ecologie fonctionnelle et évolutive/RAPPORT_Annalyse_de_données_CMR/Data/Devoir_EFE_colony.txt", header=T, field.types=c("f"))
#### Visualisation brute
head(col1.2) ; tail(col1.2)
str(col1.2)
## 'data.frame': 128 obs. of 2 variables:
## $ ch : chr "11100000" "11100000" "11001000" "11000000" ...
## $ colony: Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ...
summary(col1.2)
## ch colony
## Length:128 1:35
## Class :character 2:93
## Mode :character
#### Traitement des données d'analyse de CMR, préparation pour l'utilisation du modèle CJS
colonie_data.process <- process.data(col1.2, model="CJS", groups="colony")
#### Résumé des données préparées pour le modèle CJS
summary(colonie_data.process)
## Length Class Mode
## data 3 data.frame list
## model 1 -none- character
## mixtures 1 -none- numeric
## freq 2 data.frame list
## nocc 1 -none- numeric
## nocc.secondary 0 -none- NULL
## time.intervals 7 -none- numeric
## begin.time 1 -none- numeric
## age.unit 1 -none- numeric
## initial.ages 2 -none- numeric
## group.covariates 1 data.frame list
## nstrata 1 -none- numeric
## strata.labels 0 -none- NULL
## counts 0 -none- NULL
## reverse 1 -none- logical
## areas 0 -none- NULL
## events 0 -none- NULL
#### Conception des "design data", données pour la modélisation
colonie_data.ddl <-
make.design.data(colonie_data.process)
colonie_data.ddl
## $Phi
## par.index model.index group cohort age time occ.cohort Cohort Age Time
## 1 1 1 1 1 0 1 1 0 0 0
## 2 2 2 1 1 1 2 1 0 1 1
## 3 3 3 1 1 2 3 1 0 2 2
## 4 4 4 1 1 3 4 1 0 3 3
## 5 5 5 1 1 4 5 1 0 4 4
## 6 6 6 1 1 5 6 1 0 5 5
## 7 7 7 1 1 6 7 1 0 6 6
## 8 8 8 1 2 0 2 2 1 0 1
## 9 9 9 1 2 1 3 2 1 1 2
## 10 10 10 1 2 2 4 2 1 2 3
## 11 11 11 1 2 3 5 2 1 3 4
## 12 12 12 1 2 4 6 2 1 4 5
## 13 13 13 1 2 5 7 2 1 5 6
## 14 14 14 1 3 0 3 3 2 0 2
## 15 15 15 1 3 1 4 3 2 1 3
## 16 16 16 1 3 2 5 3 2 2 4
## 17 17 17 1 3 3 6 3 2 3 5
## 18 18 18 1 3 4 7 3 2 4 6
## 19 19 19 1 4 0 4 4 3 0 3
## 20 20 20 1 4 1 5 4 3 1 4
## 21 21 21 1 4 2 6 4 3 2 5
## 22 22 22 1 4 3 7 4 3 3 6
## 23 23 23 1 5 0 5 5 4 0 4
## 24 24 24 1 5 1 6 5 4 1 5
## 25 25 25 1 5 2 7 5 4 2 6
## 26 26 26 1 6 0 6 6 5 0 5
## 27 27 27 1 6 1 7 6 5 1 6
## 28 28 28 1 7 0 7 7 6 0 6
## 29 29 29 2 1 0 1 1 0 0 0
## 30 30 30 2 1 1 2 1 0 1 1
## 31 31 31 2 1 2 3 1 0 2 2
## 32 32 32 2 1 3 4 1 0 3 3
## 33 33 33 2 1 4 5 1 0 4 4
## 34 34 34 2 1 5 6 1 0 5 5
## 35 35 35 2 1 6 7 1 0 6 6
## 36 36 36 2 2 0 2 2 1 0 1
## 37 37 37 2 2 1 3 2 1 1 2
## 38 38 38 2 2 2 4 2 1 2 3
## 39 39 39 2 2 3 5 2 1 3 4
## 40 40 40 2 2 4 6 2 1 4 5
## 41 41 41 2 2 5 7 2 1 5 6
## 42 42 42 2 3 0 3 3 2 0 2
## 43 43 43 2 3 1 4 3 2 1 3
## 44 44 44 2 3 2 5 3 2 2 4
## 45 45 45 2 3 3 6 3 2 3 5
## 46 46 46 2 3 4 7 3 2 4 6
## 47 47 47 2 4 0 4 4 3 0 3
## 48 48 48 2 4 1 5 4 3 1 4
## 49 49 49 2 4 2 6 4 3 2 5
## 50 50 50 2 4 3 7 4 3 3 6
## 51 51 51 2 5 0 5 5 4 0 4
## 52 52 52 2 5 1 6 5 4 1 5
## 53 53 53 2 5 2 7 5 4 2 6
## 54 54 54 2 6 0 6 6 5 0 5
## 55 55 55 2 6 1 7 6 5 1 6
## 56 56 56 2 7 0 7 7 6 0 6
## colony
## 1 1
## 2 1
## 3 1
## 4 1
## 5 1
## 6 1
## 7 1
## 8 1
## 9 1
## 10 1
## 11 1
## 12 1
## 13 1
## 14 1
## 15 1
## 16 1
## 17 1
## 18 1
## 19 1
## 20 1
## 21 1
## 22 1
## 23 1
## 24 1
## 25 1
## 26 1
## 27 1
## 28 1
## 29 2
## 30 2
## 31 2
## 32 2
## 33 2
## 34 2
## 35 2
## 36 2
## 37 2
## 38 2
## 39 2
## 40 2
## 41 2
## 42 2
## 43 2
## 44 2
## 45 2
## 46 2
## 47 2
## 48 2
## 49 2
## 50 2
## 51 2
## 52 2
## 53 2
## 54 2
## 55 2
## 56 2
##
## $p
## par.index model.index group cohort age time occ.cohort Cohort Age Time
## 1 1 57 1 1 1 2 1 0 1 0
## 2 2 58 1 1 2 3 1 0 2 1
## 3 3 59 1 1 3 4 1 0 3 2
## 4 4 60 1 1 4 5 1 0 4 3
## 5 5 61 1 1 5 6 1 0 5 4
## 6 6 62 1 1 6 7 1 0 6 5
## 7 7 63 1 1 7 8 1 0 7 6
## 8 8 64 1 2 1 3 2 1 1 1
## 9 9 65 1 2 2 4 2 1 2 2
## 10 10 66 1 2 3 5 2 1 3 3
## 11 11 67 1 2 4 6 2 1 4 4
## 12 12 68 1 2 5 7 2 1 5 5
## 13 13 69 1 2 6 8 2 1 6 6
## 14 14 70 1 3 1 4 3 2 1 2
## 15 15 71 1 3 2 5 3 2 2 3
## 16 16 72 1 3 3 6 3 2 3 4
## 17 17 73 1 3 4 7 3 2 4 5
## 18 18 74 1 3 5 8 3 2 5 6
## 19 19 75 1 4 1 5 4 3 1 3
## 20 20 76 1 4 2 6 4 3 2 4
## 21 21 77 1 4 3 7 4 3 3 5
## 22 22 78 1 4 4 8 4 3 4 6
## 23 23 79 1 5 1 6 5 4 1 4
## 24 24 80 1 5 2 7 5 4 2 5
## 25 25 81 1 5 3 8 5 4 3 6
## 26 26 82 1 6 1 7 6 5 1 5
## 27 27 83 1 6 2 8 6 5 2 6
## 28 28 84 1 7 1 8 7 6 1 6
## 29 29 85 2 1 1 2 1 0 1 0
## 30 30 86 2 1 2 3 1 0 2 1
## 31 31 87 2 1 3 4 1 0 3 2
## 32 32 88 2 1 4 5 1 0 4 3
## 33 33 89 2 1 5 6 1 0 5 4
## 34 34 90 2 1 6 7 1 0 6 5
## 35 35 91 2 1 7 8 1 0 7 6
## 36 36 92 2 2 1 3 2 1 1 1
## 37 37 93 2 2 2 4 2 1 2 2
## 38 38 94 2 2 3 5 2 1 3 3
## 39 39 95 2 2 4 6 2 1 4 4
## 40 40 96 2 2 5 7 2 1 5 5
## 41 41 97 2 2 6 8 2 1 6 6
## 42 42 98 2 3 1 4 3 2 1 2
## 43 43 99 2 3 2 5 3 2 2 3
## 44 44 100 2 3 3 6 3 2 3 4
## 45 45 101 2 3 4 7 3 2 4 5
## 46 46 102 2 3 5 8 3 2 5 6
## 47 47 103 2 4 1 5 4 3 1 3
## 48 48 104 2 4 2 6 4 3 2 4
## 49 49 105 2 4 3 7 4 3 3 5
## 50 50 106 2 4 4 8 4 3 4 6
## 51 51 107 2 5 1 6 5 4 1 4
## 52 52 108 2 5 2 7 5 4 2 5
## 53 53 109 2 5 3 8 5 4 3 6
## 54 54 110 2 6 1 7 6 5 1 5
## 55 55 111 2 6 2 8 6 5 2 6
## 56 56 112 2 7 1 8 7 6 1 6
## colony
## 1 1
## 2 1
## 3 1
## 4 1
## 5 1
## 6 1
## 7 1
## 8 1
## 9 1
## 10 1
## 11 1
## 12 1
## 13 1
## 14 1
## 15 1
## 16 1
## 17 1
## 18 1
## 19 1
## 20 1
## 21 1
## 22 1
## 23 1
## 24 1
## 25 1
## 26 1
## 27 1
## 28 1
## 29 2
## 30 2
## 31 2
## 32 2
## 33 2
## 34 2
## 35 2
## 36 2
## 37 2
## 38 2
## 39 2
## 40 2
## 41 2
## 42 2
## 43 2
## 44 2
## 45 2
## 46 2
## 47 2
## 48 2
## 49 2
## 50 2
## 51 2
## 52 2
## 53 2
## 54 2
## 55 2
## 56 2
##
## $pimtypes
## $pimtypes$Phi
## $pimtypes$Phi$pim.type
## [1] "all"
##
##
## $pimtypes$p
## $pimtypes$p$pim.type
## [1] "all"
#### Exploration du "design data" créé
colonie_data.ddl$pimtypes
## $Phi
## $Phi$pim.type
## [1] "all"
##
##
## $p
## $p$pim.type
## [1] "all"
class(colonie_data.ddl$Phi)
## [1] "data.frame"
head(colonie_data.ddl$Phi)
Partie ### 1
Phi(colonyt) p(.)
p(t)
p(colonie)
p(temps + colonie)
p(temps colonie)
Partie ### 2
Phi(.) p(.)
Phi(temps) p(.)
Phi(colonie) p(.)
Phi(temps + colonie) p(.)
Phi(temps * colonie) p(.)
#modèle phi(t*colony)p(.):
# specifier les formules
p.constant <- list(formula = ~1)
Phi.time.colony <- list(formula = ~time*colony)
mod_phitc_pc <- mark(colonie_data.process, colonie_data.ddl, model.parameters = list(Phi = Phi.time.colony, p = p.constant))
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~1)
##
## Npar : 15
## -2lnL: 353.9155
## AICc : 386.4962
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 1.2070034 1.2744529 -1.2909243 3.7049311
## Phi:time2 -0.9779385 1.5339857 -3.9845505 2.0286735
## Phi:time3 -1.1893652 1.5902422 -4.3062400 1.9275096
## Phi:time4 -1.4147120 1.5273360 -4.4082905 1.5788666
## Phi:time5 -0.7913678 1.6399046 -4.0055809 2.4228453
## Phi:time6 0.9132993 3.4316443 -5.8127236 7.6393222
## Phi:time7 -2.3111286 1.5326346 -5.3150924 0.6928352
## Phi:colony2 2.8141120 6.3862767 -9.7029907 15.3312150
## Phi:time2:colony2 -2.0453372 6.6050831 -14.9913000 10.9006260
## Phi:time3:colony2 -1.8446664 6.4812431 -14.5479030 10.8585700
## Phi:time4:colony2 -1.0608478 6.4756873 -13.7531950 11.6314990
## Phi:time5:colony2 -2.1010278 6.4910165 -14.8234200 10.6213650
## Phi:time6:colony2 -3.7172660 7.2023979 -17.8339660 10.3994340
## Phi:time7:colony2 -1.7795010 6.4522797 -14.4259690 10.8669680
## p:(Intercept) 1.0702370 0.2539345 0.5725254 1.5679486
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.7697683 0.5570171 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 2 0.5570171 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 3 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 4 0.4482587 0.6024384 0.8928609 0.2489678
## 5 0.6024384 0.8928609 0.2489678
## 6 0.8928609 0.2489678
## 7 0.2489678
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.982383 0.7306336 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 2 0.7306336 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 3 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 4 0.8242709 0.7556026 0.7715614 0.4826284
## 5 0.7556026 0.7715614 0.4826284
## 6 0.7715614 0.4826284
## 7 0.4826284
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 2 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 3 0.744642 0.744642 0.744642 0.744642 0.744642
## 4 0.744642 0.744642 0.744642 0.744642
## 5 0.744642 0.744642 0.744642
## 6 0.744642 0.744642
## 7 0.744642
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 2 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 3 0.744642 0.744642 0.744642 0.744642 0.744642
## 4 0.744642 0.744642 0.744642 0.744642
## 5 0.744642 0.744642 0.744642
## 6 0.744642 0.744642
## 7 0.744642
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pc$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~1)
cat("Le modèle a", mod_phitc_pc$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 15 paramètres
cat("-2lnL :", mod_phitc_pc$results[["lnl"]][1], "\n")
## -2lnL : 353.9155
cat("Le modèle a", mod_phitc_pc$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 386.4962 pour AIC
#modèle phi(t*colony)p(t):
p.time <- list(formula=~time)
Phi.time.colony <- list(formula=~time*colony)
mod_phitc_pc <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.time.colony, p = p.time))
##
## Note: only 20 parameters counted of 21 specified parameters
## AICc and parameter count have been adjusted upward
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~time)
##
## Npar : 21 (unadjusted=20)
## -2lnL: 346.7694
## AICc : 393.9027 (unadjusted=391.41029)
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 0.8920740 1.016612 -1.1004858 2.884634
## Phi:time2 -0.5723019 1.304972 -3.1300478 1.985444
## Phi:time3 -0.4649351 1.647430 -3.6938986 2.764029
## Phi:time4 -1.2126353 1.344061 -3.8469957 1.421725
## Phi:time5 -0.6259153 1.403332 -3.3764458 2.124615
## Phi:time6 0.5731718 2.027436 -3.4006038 4.546947
## Phi:time7 -1.7755302 2230.284900 -4373.1341000 4369.583000
## Phi:colony2 1.7682737 1.937002 -2.0282493 5.564797
## Phi:time2:colony2 -0.9922945 2.215302 -5.3342863 3.349697
## Phi:time3:colony2 -0.8966463 2.420496 -5.6408193 3.847527
## Phi:time4:colony2 -0.0736321 2.246609 -4.4769852 4.329721
## Phi:time5:colony2 -1.1602891 2.217577 -5.5067411 3.186163
## Phi:time6:colony2 -2.2518355 2.616943 -7.3810444 2.877374
## Phi:time7:colony2 -0.6081198 1428.759600 -2800.9769000 2799.760700
## p:(Intercept) 2.0134249 1.049825 -0.0442319 4.071082
## p:time3 -1.0096340 1.198441 -3.3585795 1.339311
## p:time4 -1.9040429 1.162948 -4.1834209 0.375335
## p:time5 -1.2090461 1.175206 -3.5124498 1.094358
## p:time6 -0.0983434 1.291915 -2.6304966 2.433810
## p:time7 -0.0687108 1.480362 -2.9702208 2.832799
## p:time8 -1.3431204 4662.758700 -9140.3503000 9137.664000
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.709318 0.5792687 0.6051903 0.420539 0.5661496 0.8123337 0.2924621
## 2 0.5792687 0.6051903 0.420539 0.5661496 0.8123337 0.2924621
## 3 0.6051903 0.420539 0.5661496 0.8123337 0.2924621
## 4 0.420539 0.5661496 0.8123337 0.2924621
## 5 0.5661496 0.8123337 0.2924621
## 6 0.8123337 0.2924621
## 7 0.2924621
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.9346459 0.7494632 0.7856273 0.7980386 0.7056071 0.7274422 0.5687364
## 2 0.7494632 0.7856273 0.7980386 0.7056071 0.7274422 0.5687364
## 3 0.7856273 0.7980386 0.7056071 0.7274422 0.5687364
## 4 0.7980386 0.7056071 0.7274422 0.5687364
## 5 0.7056071 0.7274422 0.5687364
## 6 0.7274422 0.5687364
## 7 0.5687364
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.8821994 0.7318032 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 2 0.7318032 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 3 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 4 0.6909104 0.8715889 0.8748691 0.6615713
## 5 0.8715889 0.8748691 0.6615713
## 6 0.8748691 0.6615713
## 7 0.6615713
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.8821994 0.7318032 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 2 0.7318032 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 3 0.5273182 0.6909104 0.8715889 0.8748691 0.6615713
## 4 0.6909104 0.8715889 0.8748691 0.6615713
## 5 0.8715889 0.8748691 0.6615713
## 6 0.8748691 0.6615713
## 7 0.6615713
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pc$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~time)
cat("Le modèle a", mod_phitc_pc$results[["npar.unadjusted"]][1], "paramètres non ajustés et", mod_phitc_pc$results[["npar"]][1], "paramètres ajustés", "\n")
## Le modèle a 20 paramètres non ajustés et 21 paramètres ajustés
cat("-2lnL :", mod_phitc_pc$results[["lnl"]][1], "\n")
## -2lnL : 346.7694
cat("L'AIC non ajusté du modèle est de", mod_phitc_pc$results[["AICc.unadjusted"]][1], "et de", mod_phitc_pc$results[["AICc"]][1], "pour l'AIC ajusté", "\n")
## L'AIC non ajusté du modèle est de 391.4103 et de 393.9027 pour l'AIC ajusté
#modèle phi(t*colony)p(colony):
# specifier les formules
p.col <- list(formula=~colony)
Phi.time.colony <- list(formula=~time*colony)
mod_phitc_pcol <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.time.colony, p = p.col))
##
## Note: only 15 parameters counted of 16 specified parameters
## AICc and parameter count have been adjusted upward
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~colony)
##
## Npar : 16 (unadjusted=15)
## -2lnL: 351.9678
## AICc : 386.9084 (unadjusted=384.54848)
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 1.8319100 2.2861599 -2.6489634 6.312784
## Phi:time2 -1.3514326 2.5711509 -6.3908884 3.688023
## Phi:time3 -1.8358931 2.5252865 -6.7854548 3.113669
## Phi:time4 -1.9740845 2.4512873 -6.7786077 2.830439
## Phi:time5 -1.3869838 2.5192060 -6.3246276 3.550660
## Phi:time6 15.0694730 0.0000000 15.0694730 15.069473
## Phi:time7 -2.6894371 2.3981164 -7.3897453 2.010871
## Phi:colony2 1.6866143 4.4467622 -7.0290399 10.402268
## Phi:time2:colony2 -1.1949708 4.7231094 -10.4522650 8.062324
## Phi:time3:colony2 -0.6958022 4.6076270 -9.7267513 8.335147
## Phi:time4:colony2 -0.0304250 4.5765440 -9.0004515 8.939602
## Phi:time5:colony2 -1.0212708 4.6004732 -10.0381990 7.995657
## Phi:time6:colony2 -17.4303200 0.0000000 -17.4303200 -17.430320
## Phi:time7:colony2 -0.9520139 4.5098500 -9.7913201 7.887292
## p:(Intercept) 0.3385430 0.5332328 -0.7065932 1.383679
## p:colony2 0.8957229 0.6063476 -0.2927184 2.084164
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.8619891 0.6178606 0.4990042 0.4645161 0.6094322 1 0.2978563
## 2 0.6178606 0.4990042 0.4645161 0.6094322 1 0.2978563
## 3 0.4990042 0.4645161 0.6094322 1 0.2978563
## 4 0.4645161 0.6094322 1 0.2978563
## 5 0.6094322 1 0.2978563
## 6 1 0.2978563
## 7 0.2978563
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.9712103 0.725542 0.7284611 0.8196554 0.7521794 0.7609105 0.469307
## 2 0.725542 0.7284611 0.8196554 0.7521794 0.7609105 0.469307
## 3 0.7284611 0.8196554 0.7521794 0.7609105 0.469307
## 4 0.8196554 0.7521794 0.7609105 0.469307
## 5 0.7521794 0.7609105 0.469307
## 6 0.7609105 0.469307
## 7 0.469307
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366
## 2 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366
## 3 0.5838366 0.5838366 0.5838366 0.5838366 0.5838366
## 4 0.5838366 0.5838366 0.5838366 0.5838366
## 5 0.5838366 0.5838366 0.5838366
## 6 0.5838366 0.5838366
## 7 0.5838366
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643
## 2 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643
## 3 0.7745643 0.7745643 0.7745643 0.7745643 0.7745643
## 4 0.7745643 0.7745643 0.7745643 0.7745643
## 5 0.7745643 0.7745643 0.7745643
## 6 0.7745643 0.7745643
## 7 0.7745643
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pcol$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~colony)
cat("Le modèle a", mod_phitc_pcol$results[["npar.unadjusted"]][1], "paramètres non ajustés et", mod_phitc_pcol$results[["npar"]][1], "paramètres ajustés", "\n")
## Le modèle a 15 paramètres non ajustés et 16 paramètres ajustés
cat("-2lnL :", mod_phitc_pcol$results[["lnl"]][1], "\n")
## -2lnL : 351.9678
cat("L'AIC non ajusté du modèle est de", mod_phitc_pcol$results[["AICc.unadjusted"]][1], "et de", mod_phitc_pcol$results[["AICc"]][1], "pour l'AIC ajusté", "\n")
## L'AIC non ajusté du modèle est de 384.5485 et de 386.9084 pour l'AIC ajusté
#modèle phi(t*colony)p(time+colony):
# specifier les formules
p.col.et.time <- list(formula=~colony+time)
Phi.time.colony <- list(formula=~time*colony)
mod_phitc_pcolt <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.time.colony, p = p.col.et.time))
##
## Note: only 21 parameters counted of 22 specified parameters
## AICc and parameter count have been adjusted upward
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~colony + time)
##
## Npar : 22 (unadjusted=21)
## -2lnL: 344.1504
## AICc : 393.8041 (unadjusted=391.28378)
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 1.1076174 1.262284 -1.3664600 3.5816948
## Phi:time2 -0.3236602 1.857408 -3.9641797 3.3168594
## Phi:time3 -0.3384571 2.367351 -4.9784661 4.3015519
## Phi:time4 -1.4344464 1.636627 -4.6422353 1.7733426
## Phi:time5 -0.9866023 1.651498 -4.2235380 2.2503334
## Phi:time6 1.1934129 4.772007 -8.1597207 10.5465460
## Phi:time7 -1.7582028 629.665840 -1235.9033000 1232.3869000
## Phi:colony2 1.3900111 1.838545 -2.2135380 4.9935603
## Phi:time2:colony2 -1.1341773 2.308995 -5.6598083 3.3914538
## Phi:time3:colony2 -0.8692506 2.741016 -6.2416427 4.5031414
## Phi:time4:colony2 0.2950286 2.203638 -4.0241022 4.6141594
## Phi:time5:colony2 -0.6291590 2.174614 -4.8914018 3.6330839
## Phi:time6:colony2 -2.7241000 4.836591 -12.2038190 6.7556194
## Phi:time7:colony2 -0.8004594 247.977610 -486.8365800 485.2356600
## p:(Intercept) 1.2812060 1.121532 -0.9169966 3.4794087
## p:colony2 1.1172080 0.671979 -0.1998708 2.4342869
## p:time3 -1.1337088 1.220195 -3.5252917 1.2578741
## p:time4 -2.1396268 1.188569 -4.4692221 0.1899684
## p:time5 -1.4302989 1.200339 -3.7829638 0.9223661
## p:time6 -0.2557990 1.310449 -2.8242783 2.3126804
## p:time7 -0.3092380 1.498368 -3.2460395 2.6275636
## p:time8 -1.1335313 893.406120 -1752.2096000 1749.9425000
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.7516847 0.6865324 0.6833392 0.4190124 0.5302169 0.9089623 0.3428576
## 2 0.6865324 0.6833392 0.4190124 0.5302169 0.9089623 0.3428576
## 3 0.6833392 0.4190124 0.5302169 0.9089623 0.3428576
## 4 0.4190124 0.5302169 0.9089623 0.3428576
## 5 0.5302169 0.9089623 0.3428576
## 6 0.9089623 0.3428576
## 7 0.3428576
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.9239754 0.7388097 0.7841338 0.7954687 0.707209 0.7245095 0.4847463
## 2 0.7388097 0.7841338 0.7954687 0.707209 0.7245095 0.4847463
## 3 0.7841338 0.7954687 0.707209 0.7245095 0.4847463
## 4 0.7954687 0.707209 0.7245095 0.4847463
## 5 0.707209 0.7245095 0.4847463
## 6 0.7245095 0.4847463
## 7 0.4847463
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.782655 0.5368076 0.2976694 0.4627957 0.7360245 0.7255116 0.5368517
## 2 0.5368076 0.2976694 0.4627957 0.7360245 0.7255116 0.5368517
## 3 0.2976694 0.4627957 0.7360245 0.7255116 0.5368517
## 4 0.4627957 0.7360245 0.7255116 0.5368517
## 5 0.7360245 0.7255116 0.5368517
## 6 0.7255116 0.5368517
## 7 0.5368517
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.9167063 0.779835 0.5643381 0.7247437 0.8949767 0.8898467 0.7798655
## 2 0.779835 0.5643381 0.7247437 0.8949767 0.8898467 0.7798655
## 3 0.5643381 0.7247437 0.8949767 0.8898467 0.7798655
## 4 0.7247437 0.8949767 0.8898467 0.7798655
## 5 0.8949767 0.8898467 0.7798655
## 6 0.8898467 0.7798655
## 7 0.7798655
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pcolt$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~colony + time)
cat("Le modèle a", mod_phitc_pcolt$results[["npar.unadjusted"]][1], "paramètres non ajustés et", mod_phitc_pcolt$results[["npar"]][1], "paramètres ajustés", "\n")
## Le modèle a 21 paramètres non ajustés et 22 paramètres ajustés
cat("-2lnL :", mod_phitc_pcolt$results[["lnl"]][1], "\n")
## -2lnL : 344.1504
cat("L'AIC non ajusté du modèle est de", mod_phitc_pcolt$results[["AICc.unadjusted"]][1], "et de", mod_phitc_pcolt$results[["AICc"]][1], "pour l'AIC ajusté", "\n")
## L'AIC non ajusté du modèle est de 391.2838 et de 393.8041 pour l'AIC ajusté
#modèle phi(t*colony)p(time*colony):
# specifier les formules
p.col.time <- list(formula=~colony*time)
Phi.time.colony <- list(formula=~time*colony)
mod_phitc_pcol.t <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.time.colony, p = p.col.time))
##
## Note: only 24 parameters counted of 28 specified parameters
## AICc and parameter count have been adjusted upward
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~colony * time)
##
## Npar : 28 (unadjusted=24)
## -2lnL: 339.7054
## AICc : 405.0927 (unadjusted=394.48511)
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 6.931812e-01 0.8660273 -1.0042322 2.3905947
## Phi:time2 -1.823735e-01 1.3478218 -2.8241043 2.4593573
## Phi:time3 1.460309e-04 2.3434064 -4.5929305 4.5932226
## Phi:time4 5.594892e-01 4.3031017 -7.8745903 8.9935686
## Phi:time5 -1.145186e+00 1.6289258 -4.3378802 2.0475089
## Phi:time6 -5.794038e-05 1.4999912 -2.9400408 2.9399249
## Phi:time7 -2.079449e+00 1.1730885 -4.3787022 0.2198048
## Phi:colony2 2.183192e+00 2.3652643 -2.4527265 6.8191096
## Phi:time2:colony2 -1.643750e+00 2.7387853 -7.0117690 3.7242694
## Phi:time3:colony2 -1.593916e+00 3.3135830 -8.0885387 4.9007070
## Phi:time4:colony2 -2.215577e+00 4.8797249 -11.7798380 7.3486844
## Phi:time5:colony2 -8.217636e-01 2.7814774 -6.2734595 4.6299322
## Phi:time6:colony2 -1.814881e+00 2.7374502 -7.1802837 3.5505214
## Phi:time7:colony2 3.880494e-01 0.0000000 0.3880494 0.3880494
## p:(Intercept) 1.597247e+01 284.7055200 -542.0503500 573.9953000
## p:colony2 -1.427599e+01 284.7061600 -572.3000700 543.7481000
## p:time3 -1.527931e+01 284.7083700 -573.3077200 542.7491100
## p:time4 -1.637802e+01 284.7053600 -574.4005400 541.6445000
## p:time5 -1.776425e+01 284.7107100 -575.7972500 540.2687500
## p:time6 -1.568479e+01 284.7093600 -573.7151600 542.3455700
## p:time7 8.375892e+00 0.0000000 8.3758921 8.3758921
## p:time8 -5.670662e+00 739.5516400 -1455.1919000 1443.8506000
## p:colony2:time3 1.466966e+01 284.7098000 -543.3615600 572.7008700
## p:colony2:time4 1.486693e+01 284.7063000 -543.1574200 572.8912900
## p:colony2:time5 1.737882e+01 284.7122000 -540.6571000 575.4147400
## p:colony2:time6 1.649299e+01 284.7122400 -541.5430200 574.5290000
## p:colony2:time7 -8.220016e+00 0.0000000 -8.2200164 -8.2200164
## p:colony2:time8 3.932805e+00 738.1708000 -1442.8820000 1450.7476000
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.6666742 0.6249958 0.6667067 0.7777618 0.3888843 0.6666614 0.2000043
## 2 0.6249958 0.6667067 0.7777618 0.3888843 0.6666614 0.2000043
## 3 0.6667067 0.7777618 0.3888843 0.6666614 0.2000043
## 4 0.7777618 0.3888843 0.6666614 0.2000043
## 5 0.3888843 0.6666614 0.2000043
## 6 0.6666614 0.2000043
## 7 0.2000043
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.946666 0.7408228 0.7828925 0.7721138 0.7128822 0.7429644 0.7658409
## 2 0.7408228 0.7828925 0.7721138 0.7128822 0.7429644 0.7658409
## 3 0.7828925 0.7721138 0.7128822 0.7429644 0.7658409
## 4 0.7721138 0.7128822 0.7429644 0.7658409
## 5 0.7128822 0.7429644 0.7658409
## 6 0.7429644 0.7658409
## 7 0.7658409
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.9999999 0.6666712 0.3999802 0.1428554 0.5714279 1 0.9999664
## 2 0.6666712 0.3999802 0.1428554 0.5714279 1 0.9999664
## 3 0.3999802 0.1428554 0.5714279 1 0.9999664
## 4 0.1428554 0.5714279 1 0.9999664
## 5 0.5714279 1 0.9999664
## 6 1 0.9999664
## 7 0.9999664
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.8450754 0.7477858 0.546218 0.7876906 0.9244698 0.8644043 0.4896589
## 2 0.7477858 0.546218 0.7876906 0.9244698 0.8644043 0.4896589
## 3 0.546218 0.7876906 0.9244698 0.8644043 0.4896589
## 4 0.7876906 0.9244698 0.8644043 0.4896589
## 5 0.9244698 0.8644043 0.4896589
## 6 0.8644043 0.4896589
## 7 0.4896589
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pcol.t$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~colony * time)
cat("Le modèle a", mod_phitc_pcol.t$results[["npar.unadjusted"]][1], "paramètres non ajustés et", mod_phitc_pcol.t$results[["npar"]][1], "paramètres ajustés", "\n")
## Le modèle a 24 paramètres non ajustés et 28 paramètres ajustés
cat("-2lnL :", mod_phitc_pcol.t$results[["lnl"]][1], "\n")
## -2lnL : 339.7054
cat("Le modèle a", mod_phitc_pcol.t$results[["AICc.unadjusted"]][1], "pour AIC non ajustée et", mod_phitc_pcol.t$results[["AICc"]][1], "pour AIC ajusté", "\n")
## Le modèle a 394.4851 pour AIC non ajustée et 405.0927 pour AIC ajusté
Sélection du modèle 1 p(.) avec un p constant.
#modèle phi(.)p(.):
# specifier les formules
p.constant <- list(formula=~1)
Phi.constant <- list(formula=~1)
mod_phic_pc <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.constant, p = p.constant))
##
## Output summary for CJS model
## Name : Phi(~1)p(~1)
##
## Npar : 2
## -2lnL: 372.8533
## AICc : 376.9136
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 0.8524383 0.1753794 0.5086948 1.196182
## p:(Intercept) 0.8881233 0.2391869 0.4193170 1.356930
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 2 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 3 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 4 0.7010784 0.7010784 0.7010784 0.7010784
## 5 0.7010784 0.7010784 0.7010784
## 6 0.7010784 0.7010784
## 7 0.7010784
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 2 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 3 0.7010784 0.7010784 0.7010784 0.7010784 0.7010784
## 4 0.7010784 0.7010784 0.7010784 0.7010784
## 5 0.7010784 0.7010784 0.7010784
## 6 0.7010784 0.7010784
## 7 0.7010784
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 2 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 3 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 4 0.7085027 0.7085027 0.7085027 0.7085027
## 5 0.7085027 0.7085027 0.7085027
## 6 0.7085027 0.7085027
## 7 0.7085027
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 2 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 3 0.7085027 0.7085027 0.7085027 0.7085027 0.7085027
## 4 0.7085027 0.7085027 0.7085027 0.7085027
## 5 0.7085027 0.7085027 0.7085027
## 6 0.7085027 0.7085027
## 7 0.7085027
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phic_pc$model.name, "\n")
## Le modèle calculé est : Phi(~1)p(~1)
cat("Le modèle a", mod_phic_pc$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 2 paramètres
cat("-2lnL :", mod_phic_pc$results[["lnl"]][1], "\n")
## -2lnL : 372.8533
cat("Le modèle a", mod_phic_pc$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 376.9136 pour AIC
Après un ajustement des paramètres, les nouveaux AIC et AIC non ajusté sont :
adjust.parameter.count(mod_phic_pc,1)
##
## Number of parameters adjusted from 2 to 1
## Adjusted AICc = 374.87329
## Unadjusted AICc = 376.9136
#modèle phi(t)p(.):
# specifier les formules
p.constant <- list(formula=~1)
Phi.time <- list(formula=~time)
mod_phit_pc <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.time, p = p.constant))
##
## Output summary for CJS model
## Name : Phi(~time)p(~1)
##
## Npar : 8
## -2lnL: 362.2662
## AICc : 379.0123
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 2.2494587 1.3061138 -0.3105243 4.8094417
## Phi:time2 -1.5542454 1.4417278 -4.3800320 1.2715412
## Phi:time3 -1.4773121 1.3928766 -4.2073502 1.2527261
## Phi:time4 -1.2296975 1.3935760 -3.9611064 1.5017114
## Phi:time5 -1.2532921 1.3949732 -3.9874396 1.4808555
## Phi:time6 -0.9241488 1.4512735 -3.7686450 1.9203474
## Phi:time7 -2.5026018 1.3406331 -5.1302427 0.1250391
## p:(Intercept) 1.0638307 0.2537879 0.5664065 1.5612550
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.9046038 0.6671257 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 2 0.6671257 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 3 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 4 0.7349261 0.7303042 0.7900638 0.43705
## 5 0.7303042 0.7900638 0.43705
## 6 0.7900638 0.43705
## 7 0.43705
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.9046038 0.6671257 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 2 0.6671257 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 3 0.6839851 0.7349261 0.7303042 0.7900638 0.43705
## 4 0.7349261 0.7303042 0.7900638 0.43705
## 5 0.7303042 0.7900638 0.43705
## 6 0.7900638 0.43705
## 7 0.43705
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 2 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 3 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 4 0.7434219 0.7434219 0.7434219 0.7434219
## 5 0.7434219 0.7434219 0.7434219
## 6 0.7434219 0.7434219
## 7 0.7434219
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 2 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 3 0.7434219 0.7434219 0.7434219 0.7434219 0.7434219
## 4 0.7434219 0.7434219 0.7434219 0.7434219
## 5 0.7434219 0.7434219 0.7434219
## 6 0.7434219 0.7434219
## 7 0.7434219
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phit_pc$model.name, "\n")
## Le modèle calculé est : Phi(~time)p(~1)
cat("Le modèle a", mod_phit_pc$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 8 paramètres
cat("-2lnL :", mod_phit_pc$results[["lnl"]][1], "\n")
## -2lnL : 362.2662
cat("Le modèle a", mod_phit_pc$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 379.0123 pour AIC
#modèle phi(colony)p(.):
# specifier les formules
p.constant <- list(formula=~1)
Phi.col <- list(formula=~colony)
mod_phicol_pc <- mark(colonie_data.process,colonie_data.ddl,
model.parameters=list(Phi = Phi.col, p = p.constant))
##
## Output summary for CJS model
## Name : Phi(~colony)p(~1)
##
## Npar : 3
## -2lnL: 367.4051
## AICc : 373.5263
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 0.2221749 0.3109808 -0.3873474 0.8316973
## Phi:colony2 0.8582301 0.3646688 0.1434793 1.5729810
## p:(Intercept) 0.8815436 0.2388674 0.4133634 1.3497238
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164
## 2 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164
## 3 0.5553164 0.5553164 0.5553164 0.5553164 0.5553164
## 4 0.5553164 0.5553164 0.5553164 0.5553164
## 5 0.5553164 0.5553164 0.5553164
## 6 0.5553164 0.5553164
## 7 0.5553164
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706
## 2 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706
## 3 0.7465706 0.7465706 0.7465706 0.7465706 0.7465706
## 4 0.7465706 0.7465706 0.7465706 0.7465706
## 5 0.7465706 0.7465706 0.7465706
## 6 0.7465706 0.7465706
## 7 0.7465706
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142
## 2 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142
## 3 0.707142 0.707142 0.707142 0.707142 0.707142
## 4 0.707142 0.707142 0.707142 0.707142
## 5 0.707142 0.707142 0.707142
## 6 0.707142 0.707142
## 7 0.707142
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142
## 2 0.707142 0.707142 0.707142 0.707142 0.707142 0.707142
## 3 0.707142 0.707142 0.707142 0.707142 0.707142
## 4 0.707142 0.707142 0.707142 0.707142
## 5 0.707142 0.707142 0.707142
## 6 0.707142 0.707142
## 7 0.707142
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phicol_pc$model.name, "\n")
## Le modèle calculé est : Phi(~colony)p(~1)
cat("Le modèle a", mod_phicol_pc$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 3 paramètres
cat("-2lnL :", mod_phicol_pc$results[["lnl"]][1], "\n")
## -2lnL : 367.4051
cat("Le modèle a", mod_phicol_pc$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 373.5263 pour AIC
#modèle phi(t+colony)p(.):
# specifier les formules
p.constant <- list(formula=~1)
Phi.time.et.colony <- list(formula=~time+colony)
mod_phitcol_pt <- mark(colonie_data.process,colonie_data.ddl,model.parameters=list(Phi=Phi.time.et.colony,p=p.constant))
##
## Output summary for CJS model
## Name : Phi(~time + colony)p(~1)
##
## Npar : 9
## -2lnL: 355.613
## AICc : 374.5505
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 1.6742752 1.2556969 -0.7868907 4.1354412
## Phi:time2 -1.5445203 1.3821782 -4.2535897 1.1645492
## Phi:time3 -1.6411512 1.3428176 -4.2730738 0.9907714
## Phi:time4 -1.3607398 1.3441206 -3.9952163 1.2737366
## Phi:time5 -1.4436287 1.3474757 -4.0846811 1.1974236
## Phi:time6 -1.1048127 1.4200991 -3.8882070 1.6785815
## Phi:time7 -2.7280767 1.2944459 -5.2651908 -0.1909627
## Phi:colony2 0.9591106 0.3729521 0.2281246 1.6900967
## p:(Intercept) 1.0624338 0.2539495 0.5646928 1.5601748
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.842145 0.5323933 0.5082803 0.577748 0.5574074 0.6386391 0.2584958
## 2 0.5323933 0.5082803 0.577748 0.5574074 0.6386391 0.2584958
## 3 0.5082803 0.577748 0.5574074 0.6386391 0.2584958
## 4 0.577748 0.5574074 0.6386391 0.2584958
## 5 0.5574074 0.6386391 0.2584958
## 6 0.6386391 0.2584958
## 7 0.2584958
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.9329796 0.748168 0.7295291 0.7811954 0.7666976 0.8217974 0.476345
## 2 0.748168 0.7295291 0.7811954 0.7666976 0.8217974 0.476345
## 3 0.7295291 0.7811954 0.7666976 0.8217974 0.476345
## 4 0.7811954 0.7666976 0.8217974 0.476345
## 5 0.7666976 0.8217974 0.476345
## 6 0.8217974 0.476345
## 7 0.476345
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 2 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 3 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 4 0.7431554 0.7431554 0.7431554 0.7431554
## 5 0.7431554 0.7431554 0.7431554
## 6 0.7431554 0.7431554
## 7 0.7431554
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 2 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 3 0.7431554 0.7431554 0.7431554 0.7431554 0.7431554
## 4 0.7431554 0.7431554 0.7431554 0.7431554
## 5 0.7431554 0.7431554 0.7431554
## 6 0.7431554 0.7431554
## 7 0.7431554
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitcol_pt$model.name, "\n")
## Le modèle calculé est : Phi(~time + colony)p(~1)
cat("Le modèle a", mod_phitcol_pt$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 9 paramètres
cat("-2lnL :", mod_phitcol_pt$results[["lnl"]][1], "\n")
## -2lnL : 355.613
cat("Le modèle a", mod_phitcol_pt$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 374.5505 pour AIC
#modèle phi(t*colony)p(.):
# specifier les formules
p.constant <- list(formula=~1)
Phi.time.colony <- list(formula=~time*colony)
mod_phitc_pt <- mark(colonie_data.process,colonie_data.ddl,model.parameters=list(Phi=Phi.time.colony,p=p.constant))
##
## Output summary for CJS model
## Name : Phi(~time * colony)p(~1)
##
## Npar : 15
## -2lnL: 353.9155
## AICc : 386.4962
##
## Beta
## estimate se lcl ucl
## Phi:(Intercept) 1.2070034 1.2744529 -1.2909243 3.7049311
## Phi:time2 -0.9779385 1.5339857 -3.9845505 2.0286735
## Phi:time3 -1.1893652 1.5902422 -4.3062400 1.9275096
## Phi:time4 -1.4147120 1.5273360 -4.4082905 1.5788666
## Phi:time5 -0.7913678 1.6399046 -4.0055809 2.4228453
## Phi:time6 0.9132993 3.4316443 -5.8127236 7.6393222
## Phi:time7 -2.3111286 1.5326346 -5.3150924 0.6928352
## Phi:colony2 2.8141120 6.3862767 -9.7029907 15.3312150
## Phi:time2:colony2 -2.0453372 6.6050831 -14.9913000 10.9006260
## Phi:time3:colony2 -1.8446664 6.4812431 -14.5479030 10.8585700
## Phi:time4:colony2 -1.0608478 6.4756873 -13.7531950 11.6314990
## Phi:time5:colony2 -2.1010278 6.4910165 -14.8234200 10.6213650
## Phi:time6:colony2 -3.7172660 7.2023979 -17.8339660 10.3994340
## Phi:time7:colony2 -1.7795010 6.4522797 -14.4259690 10.8669680
## p:(Intercept) 1.0702370 0.2539345 0.5725254 1.5679486
##
##
## Real Parameter Phi
## Group:colony1
## 1 2 3 4 5 6 7
## 1 0.7697683 0.5570171 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 2 0.5570171 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 3 0.5044094 0.4482587 0.6024384 0.8928609 0.2489678
## 4 0.4482587 0.6024384 0.8928609 0.2489678
## 5 0.6024384 0.8928609 0.2489678
## 6 0.8928609 0.2489678
## 7 0.2489678
##
## Group:colony2
## 1 2 3 4 5 6 7
## 1 0.982383 0.7306336 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 2 0.7306336 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 3 0.7285115 0.8242709 0.7556026 0.7715614 0.4826284
## 4 0.8242709 0.7556026 0.7715614 0.4826284
## 5 0.7556026 0.7715614 0.4826284
## 6 0.7715614 0.4826284
## 7 0.4826284
##
##
## Real Parameter p
## Group:colony1
## 2 3 4 5 6 7 8
## 1 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 2 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 3 0.744642 0.744642 0.744642 0.744642 0.744642
## 4 0.744642 0.744642 0.744642 0.744642
## 5 0.744642 0.744642 0.744642
## 6 0.744642 0.744642
## 7 0.744642
##
## Group:colony2
## 2 3 4 5 6 7 8
## 1 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 2 0.744642 0.744642 0.744642 0.744642 0.744642 0.744642
## 3 0.744642 0.744642 0.744642 0.744642 0.744642
## 4 0.744642 0.744642 0.744642 0.744642
## 5 0.744642 0.744642 0.744642
## 6 0.744642 0.744642
## 7 0.744642
#### ~~~~~~ Les AIC, nombres de paramètres par modèle ~~~~~~ ####
#mod_phitc_pc$results # TOUS LES RESULTATS
cat("Le modèle calculé est :", mod_phitc_pt$model.name, "\n")
## Le modèle calculé est : Phi(~time * colony)p(~1)
cat("Le modèle a", mod_phitc_pt$results[["npar"]][1], "paramètres", "\n")
## Le modèle a 15 paramètres
cat("-2lnL :", mod_phitc_pt$results[["lnl"]][1], "\n")
## -2lnL : 353.9155
cat("Le modèle a", mod_phitc_pt$results[["AICc"]][1], "pour AIC", "\n")
## Le modèle a 386.4962 pour AIC
release.gof(data.colony.process)
##
## Windows only function. Release.exe does not work on non-Windows machine
## NULL
#~~~~~~~~~~~~~~~~~~~~~~~ Code des tableaux à la main ~~~~~~~~~~~~~~~~~~~~~~~#
# Créer vecteurs
Modeles <- c("Phi(temps * colonie)p(.)", "Phi(temps * colonie)p(temps)", "Phi(temps * colonie)p(colonie)", "Phi(temps * colonie)p(temps + colonie)", "Phi(temps * colonie)p(temps * colonie)")
Nb_de_parametres_estimables_non_ajustes <- c(15, 21, 16, 22, 28)
Nb_de_parametres_estimables_ajustes <- c(" ", 20, 15, 21, 24)
AICc <- c(386.4962, 393.9027, 386.9084, 393.8041, 405.0927)
AICc_ajuste <- c(" ", 391.41029, 384.54848, 391.28378, 394.48511)
# Créer un dataframe
df <- data.frame("Modèles" = Modeles, "Nombre de paramètres estimables" = Nb_de_parametres_estimables_non_ajustes, "Nombre de paramètres estimables ajustés" = Nb_de_parametres_estimables_ajustes, "AICc" = AICc, "AICc ajusté" = AICc_ajuste)
# Utiliser kable pour créer le tableau avec des options de formatage
df_format <- df %>%
kable(col.names = c("Modèles", "Paramètres théoriques", "Paramètres estimés ajustés", "AIC", "AIC ajusté")) %>%
kable_styling(bootstrap_options = "striped", latex_options = "scale_down", full_width = FALSE, position = "center", html_font = "arial")
df_format
| Modèles | Paramètres théoriques | Paramètres estimés ajustés | AIC | AIC ajusté |
|---|---|---|---|---|
| Phi(temps * colonie)p(.) | 15 | 386.4962 | ||
| Phi(temps * colonie)p(temps) | 21 | 20 | 393.9027 | 391.41029 |
| Phi(temps * colonie)p(colonie) | 16 | 15 | 386.9084 | 384.54848 |
| Phi(temps * colonie)p(temps + colonie) | 22 | 21 | 393.8041 | 391.28378 |
| Phi(temps * colonie)p(temps * colonie) | 28 | 24 | 405.0927 | 394.48511 |
Modeles <- c("Phi(.)p(.)", "Phi(temps)p(.)", "Phi(colonie)p(.)", "Phi(temps + colonie)p(.)", "Phi(temps * colonie)p(.)")
Nb_de_parametres_estimables_non_ajustes <- c(2, 8, 3, 9, 15)
#Nb_de_parametres_estimables_ajustes <- c(2, 7, "Na", 9, 14)
AICc <- c(376.9136, 379.0123, 373.52628, 374.5505, 386.4962)
#AICc_ajuste <- c(374.87329, 379.0123, 371.465371, 372.3591, 384.1615)
Delta_AIC <- c(3.4078, 7.5469, 0, 0.8937, 12.6961)
# Créer un dataframe
df <- data.frame("Modèles" = Modeles, "Nombre de paramètres estimables" = Nb_de_parametres_estimables_non_ajustes, "AIC" = AICc, "Delta" = Delta_AIC)
# Utiliser kable pour créer le tableau avec des options de formatage
df_format <- df %>%
kable(col.names = c("Modèles", "Paramètres théoriques", "AIC", "Delta AIC")) %>%
kable_styling(bootstrap_options = "striped", latex_options = "scale_down", full_width = FALSE, position = "center", html_font = "arial") ; df_format
| Modèles | Paramètres théoriques | AIC | Delta AIC |
|---|---|---|---|
| Phi(.)p(.) | 2 | 376.9136 | 3.4078 |
| Phi(temps)p(.) | 8 | 379.0123 | 7.5469 |
| Phi(colonie)p(.) | 3 | 373.5263 | 0.0000 |
| Phi(temps + colonie)p(.) | 9 | 374.5505 | 0.8937 |
| Phi(temps * colonie)p(.) | 15 | 386.4962 | 12.6961 |
Tests <- c("TEST 2", "TEST 3", "TOTAL")
Chi <- c(3.3487, 5.8102, 9.1589)
ddl <- c(8, 16, 24)
p <- c(0.9106, 0.9900, 0.9972)
# Créer un dataframe
df <- data.frame(Tests, Chi, ddl, p)
# Utiliser kable pour créer le tableau avec des options de formatage
df_format <- df %>%
kable(col.names = c("Tests", "Chi quarré", "Degrés de liberté", "P-value")) %>%
kable_styling(bootstrap_options = "striped", latex_options = "scale_down", full_width = FALSE, position = "center", html_font = "arial") ; df_format
| Tests | Chi quarré | Degrés de liberté | P-value |
|---|---|---|---|
| TEST 2 | 3.3487 | 8 | 0.9106 |
| TEST 3 | 5.8102 | 16 | 0.9900 |
| TOTAL | 9.1589 | 24 | 0.9972 |