# Compute Summary Statistics from Detection Histories

### Description

This function extracts various summary statistics from detection history
data of various `unmarkedFrame`

and `unmarkedFit`

classes.

### Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
detHist(object, ...)
## S3 method for class 'unmarkedFitColExt'
detHist(object, ...)
## S3 method for class 'unmarkedFitOccu'
detHist(object, ...)
## S3 method for class 'unmarkedFitOccuFP'
detHist(object, ...)
## S3 method for class 'unmarkedFitOccuRN'
detHist(object, ...)
## S3 method for class 'unmarkedFrameOccu'
detHist(object, ...)
## S3 method for class 'unmarkedFrameOccuFP'
detHist(object, ...)
## S3 method for class 'unmarkedMultFrame'
detHist(object, ...)
``` |

### Arguments

`object` |
an object of various |

`...` |
additional arguments passed to the function. |

### Details

This function computes a number of summary statistics in data sets used for single-season occupancy models (MacKenzie et al. 2002), dynamic occupancy models (MacKenzie et al. 2003), Royle-Nichols models (Royle and Nichols 2003), and false-positive occupancy models (Royle and Link 2006, Miller et al. 2011).

`detHist`

can take data frames of the `unmarkedFrameOccu`

,
`unmarkedFrameOccuFP`

, and `unmarkedMultFrame`

classes as
input. For convenience, the function can also extract the raw data
from model objects of classes `unmarkedFitColExt`

,
`unmarkedFitOccu`

, `unmarkedFitOccuFP`

, and
`detHist.unmarkedFitOccuRN`

. Note that different model objects
using the same data set will have identical values.

### Value

`detHist`

returns a list with the following components:

`hist.table.full` |
a table with the frequency of each observed detection history. |

`hist.table.seasons` |
a list of tables with the frequency of each season-specific detection history. |

`out.freqs` |
a matrix where the rows correspond to each sampling
season and where columns consist of the number of sites sampled in
season |

`out.props` |
a matrix where the rows correspond to each sampling
season and where columns consist of the proportion of sites in
season |

`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. |

### Author(s)

Marc J. Mazerolle

### References

MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle,
J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when
detection probabilities are less than one. *Ecology* **83**,
2248–2255.

MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G.,
Franklin, A. B. (2003) Estimating site occupancy, colonization, and
local extinction when a species is detected imperfectly. *Ecology*
**84**, 2200–2207.

Mazerolle, M. J. (2015) Estimating detectability and biological
parameters of interest with the use of the R
environment. *Journal of Herpetology* **49**, 541–559.

Miller, D. A. W., Nichols, J. D., McClintock, B. T., Campbell
Grant, E. H., Bailey, L. L. (2011) Improving occupancy estimation when
two types of observational error occur: non-detection and species
misidentification. *Ecology* **92**, 1422–1428.

Royle, J. A., Link, W. A. (2006) Generalized site occupancy models
allowing for false positive and false negative errors. *Ecology*
**87**, 835–841.

Royle, J. A., Nichols, J. D. (2003) Estimating abundance from
repeated presence-absence data or point counts. *Ecology*
**84**, 777–790.

### See Also

`covDiag`

, `countHist`

, `countDist`

,
`mb.chisq`

, `mb.gof.test`

,

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
##data from Mazerolle (2015)
## Not run:
data(bullfrog)
##detection data
detections <- bullfrog[, 3:9]
##load unmarked package
if(require(unmarked)){
##assemble in unmarkedFrameOccu
bfrog <- unmarkedFrameOccu(y = detections)
##compute descriptive stats from data object
detHist(bfrog)
##run model
fm <- occu(~ 1 ~ 1, data = bfrog)
##compute descriptive stats from model object
detHist(fm)
}
## End(Not run)
``` |