unmarked
model fitsmodSel.Rd
Model selection results from an unmarkedFitList
an object of class "unmarkedFitList" created by the function
fitList
.
optional character naming which model in the
fitList
contains results from the null model. Only used in
calculation of Nagelkerke's R-squared index.
An object of class unmarkedModSel
.
Two requirements exist to conduct AIC-based model-selection and model-averaging in unmarked. First, the data objects (ie, unmarkedFrames) must be identical among fitted models. Second, the response matrix must be identical among fitted models after missing values have been removed. This means that if a response value was removed in one model due to missingness, it needs to be removed from all models.
Nagelkerke, N.J.D. (2004) A Note on a General Definition of the Coefficient of Determination. Biometrika 78, pp. 691-692.
data(linetran)
(dbreaksLine <- c(0, 5, 10, 15, 20))
#> [1] 0 5 10 15 20
lengths <- linetran$Length * 1000
ltUMF <- with(linetran, {
unmarkedFrameDS(y = cbind(dc1, dc2, dc3, dc4),
siteCovs = data.frame(Length, area, habitat), dist.breaks = dbreaksLine,
tlength = lengths, survey = "line", unitsIn = "m")
})
fm1 <- distsamp(~ 1 ~1, ltUMF)
fm2 <- distsamp(~ area ~1, ltUMF)
fm3 <- distsamp( ~ 1 ~area, ltUMF)
fl <- fitList(Null=fm1, A.=fm2, .A=fm3)
fl
#> An object of class "unmarkedFitList"
#> Slot "fits":
#> $Null
#>
#> Call:
#> distsamp(formula = ~1 ~ 1, data = ltUMF)
#>
#> Density (log-scale):
#> Estimate SE z P(>|z|)
#> -0.171 0.134 -1.28 0.201
#>
#> Detection (log-scale):
#> Estimate SE z P(>|z|)
#> 2.39 0.127 18.7 2.46e-78
#>
#> AIC: 164.7524
#> Number of sites: 12
#>
#> Survey design: line-transect
#> Detection function: halfnorm
#> UnitsIn: m
#> UnitsOut: ha
#>
#>
#> $A.
#>
#> Call:
#> distsamp(formula = ~area ~ 1, data = ltUMF)
#>
#> Density (log-scale):
#> Estimate SE z P(>|z|)
#> -0.168 0.134 -1.25 0.21
#>
#> Detection (log-scale):
#> Estimate SE z P(>|z|)
#> (Intercept) 3.00 0.5402 5.56 2.72e-08
#> area -0.12 0.0955 -1.26 2.07e-01
#>
#> AIC: 165.1845
#> Number of sites: 12
#>
#> Survey design: line-transect
#> Detection function: halfnorm
#> UnitsIn: m
#> UnitsOut: ha
#>
#>
#> $.A
#>
#> Call:
#> distsamp(formula = ~1 ~ area, data = ltUMF)
#>
#> Density (log-scale):
#> Estimate SE z P(>|z|)
#> (Intercept) 0.2364 0.5123 0.462 0.644
#> area -0.0801 0.0979 -0.817 0.414
#>
#> Detection (log-scale):
#> Estimate SE z P(>|z|)
#> 2.39 0.127 18.7 2.47e-78
#>
#> AIC: 166.0759
#> Number of sites: 12
#>
#> Survey design: line-transect
#> Detection function: halfnorm
#> UnitsIn: m
#> UnitsOut: ha
#>
#>
#>
ms <- modSel(fl, nullmod="Null")
ms
#> nPars AIC delta AICwt cumltvWt Rsq
#> Null 2 164.75 0.00 0.43 0.43 0.000
#> A. 3 165.18 0.43 0.35 0.78 0.122
#> .A 3 166.08 1.32 0.22 1.00 0.055
coef(ms) # Estimates only
#> lam(Int) lam(area) p(Int) p(area)
#> Null -0.1710554 NA 2.386380 NA
#> A. -0.1678270 NA 3.002507 -0.120364
#> .A 0.2364320 -0.08005895 2.386386 NA
SE(ms) # Standard errors only
#> SElam(Int) SElam(area) SEp(Int) SEp(area)
#> Null 0.1337819 NA 0.1273598 NA
#> A. 0.1340212 NA 0.5401575 0.09548038
#> .A 0.5122837 0.0979427 0.1273614 NA
(toExport <- as(ms, "data.frame")) # Everything
#> model formula lam(Int) SElam(Int) lam(area) SElam(area) p(Int)
#> 1 Null ~1 ~ 1 -0.1710554 0.1337819 NA NA 2.386380
#> 2 A. ~area ~ 1 -0.1678270 0.1340212 NA NA 3.002507
#> 3 .A ~1 ~ area 0.2364320 0.5122837 -0.08005895 0.0979427 2.386386
#> SEp(Int) p(area) SEp(area) Converge CondNum negLogLike nPars n
#> 1 0.1273598 NA NA 0 5.199344 80.37622 2 12
#> 2 0.5401575 -0.120364 0.09548038 0 1065.747363 79.59224 3 12
#> 3 0.1273614 NA NA 0 783.165345 80.03795 3 12
#> AIC delta AICwt Rsq cumltvWt
#> 1 164.7524 0.0000000 0.4307243 0.00000000 0.4307243
#> 2 165.1845 0.4320554 0.3470401 0.12248591 0.7777644
#> 3 166.0759 1.3234600 0.2222356 0.05481861 1.0000000