detTime: Compute Summary Statistics from Time to Detection Data

View source: R/detTime.R

detTimeR Documentation

Compute Summary Statistics from Time to Detection Data

Description

This function extracts various summary statistics from time to detection data of various unmarkedFrame and unmarkedFit classes.

Usage

detTime(object, plot.time = TRUE, plot.seasons = FALSE,
        cex.axis = 1, cex.lab = 1, cex.main = 1, ...)

## S3 method for class 'unmarkedFrameOccuTTD'
detTime(object, plot.time = TRUE,
                 plot.seasons = FALSE, cex.axis = 1, cex.lab = 1,
                 cex.main = 1, ...)

## S3 method for class 'unmarkedFitOccuTTD'
detTime(object, plot.time = TRUE,
                   plot.seasons = FALSE, cex.axis = 1, cex.lab = 1,
                   cex.main = 1, ...)

Arguments

object

an object of various unmarkedFrame or unmarkedFit classes containing time to detection data.

plot.time

logical. Specifies if the time to detection data (pooled across seasons) should be plotted.

plot.seasons

logical. Specifies if the time to detection data should be plotted for each season separately. This argument is only relevant for data collected across more than a single season.

cex.axis

expansion factor influencing the size of axis annotations on plots produced by the function.

cex.lab

expansion factor influencing the size of axis labels on plots produced by the function.

cex.main

expansion factor influencing the size of the main title above plots produced by the function.

...

additional arguments passed to the function.

Details

This function computes a number of summary statistics in data sets used for the time to detection models of Garrard et al. (2008, 2013).

detTime can take data frames of the unmarkedFrameOccuTTD class as input, or can also extract the raw data from model objects of the unmarkedFitOccuTTD class. Note that different model objects using the same data set will have identical values.

Value

detTime returns a list with the following components:

time.table.full

a table with the quantiles of time to detection data pooled across seasons, but excluding censored observations.

time.table.seasons

a list of tables with the quantiles of season-specific time to detection data, but excluding censored observations.

out.freqs

a matrix where the rows correspond to each sampling season and where columns consist of the number of sites sampled in season t (sampled) and the number of sites with at least one detection in season t (detected). For multiseason data, the matrix includes the number of sites sampled in season t - 1 with colonizations observed in season t (colonized), the number of sites sampled in season t - 1 with extinctions observed in season t (extinct), the number of sites sampled in season t - 1 without changes observed in season t (static), and the number of sites sampled in season t that were also sampled in season t - 1 (common).

out.props

a matrix where the rows correspond to each sampling season and where columns consist of the proportion of sites in season t with at least one detection (naive.occ). For multiseason data, the matrix includes the proportion of sites sampled in season t - 1 with colonizations observed in season t (naive.colonization), the proportion of sites sampled in season t - 1 with extinctions observed in season t (naive.extinction), and the proportion of sites sampled in season t - 1 with no changes observed in season t.

n.seasons

the number of seasons (primary periods) in the data set.

n.visits.season

the maximum number of visits per season in the data set.

missing.seasons

logical vector indicating whether data were collected or not during a given season (primary period), where TRUE indicates that no data were collected during the season.

Author(s)

Marc J. Mazerolle

References

Garrard, G. E., Bekessy, S. A., McCarthy, M. A., Wintle, B. A. (2008) When have we looked hard enough? A novel method for setting minimum survey effort protocols for flora surveys. Austral Ecology 33, 986–998.

Garrard, G. E., McCarthy, M. A., Williams, N. S., Bekessy, S. A., Wintle, B. A. (2013) A general model of detectability using species traits. Methods in Ecology and Evolution 4, 45–52.

See Also

countDist, countHist, detHist, Nmix.chisq, Nmix.gof.test

Examples

##example from ?occuTTD
## Not run: 
if(require(unmarked)){
N <- 500; J <- 1
     
##Simulate occupancy
scovs <- data.frame(elev=c(scale(runif(N, 0,100))),
                    forest=runif(N,0,1),
                    wind=runif(N,0,1))
     
beta_psi <- c(-0.69, 0.71, -0.5)
psi <- plogis(cbind(1, scovs$elev, scovs$forest) 
z <- rbinom(N, 1, psi)
     
##Simulate detection
Tmax <- 10 #Same survey length for all observations
beta_lam <- c(-2, -0.2, 0.7)
rate <- exp(cbind(1, scovs$elev, scovs$wind) 
ttd <- rexp(N, rate)
ttd[z==0] <- Tmax #Censor unoccupied sites
ttd[ttd>Tmax] <- Tmax #Censor when ttd was greater than survey length
     
##Build unmarkedFrame
umf <- unmarkedFrameOccuTTD(y=ttd, surveyLength=Tmax, siteCovs=scovs)

##compute descriptive stats from data object
detTime(umf)
     
##Fit model
fit.occuTTD <- occuTTD(psiformula=~elev+forest, detformula=~elev+wind, data=umf)
##extract info from model object
detTime(fit.occuTTD)     
     
}

## End(Not run)

AICcmodavg documentation built on Nov. 17, 2023, 1:08 a.m.