Learn R Programming

secrdesign (version 2.9.2)

count: Extract Summaries

Description

Reshape results from run.scenarios(..., extractfn = summary) so that they may be passed to the usual summary functions of secrdesign.

Usage

count(object, ...)

# S3 method for summary predict(object, ...) # S3 method for summary coef(object, ...) # S3 method for summary count(object, ...)

Value

An object of class c("estimatetables", "secrdesign", "list") in which the output component for each scenario is a list of dataframes, one per replicate. The structure of each dataframe is indicated in the following table (parameters may vary with model); `parameters' and `statistics' correspond to arguments of select.stats.

FunctionRow(s)Columns
(parameters)(statistics)
countNumberAnimals, Detections, Moves
coefD, g0, sigmaestimate, SE.estimate, lcl, ucl
predictD, g0, sigmaestimate, SE.estimate, lcl, ucl

Arguments

object

summary simulation output from run.scenarios

...

other arguments (not used)

Details

The aim is to extract numerical results from simulations performed using run.scenarios(..., extractfn = summary). The results may then be passed to the summary method for `secrdesign' objects, possibly via select.stats (see Examples).

See Also

predict.secr, coef.secr,

Examples

Run this code

## generate some simulations
scen1 <- make.scenarios(D = c(5,10), sigma = 25, g0 = 0.2)
traps1 <- make.grid(6, 6, spacing = 25)
sims1 <- run.scenarios(nrepl = 2, trapset = traps1, scenarios =
     scen1, seed = 345, fit = TRUE, extractfn = summary)

## view the results
count(sims1)$output
predict(sims1)$output

summary(sims1)  ## header only

summary(count(sims1))   # equivalent to following
summary(select.stats(count(sims1), parameter = 'Number'))  

summary(predict(sims1)) # default select.stats parameter = 'D'
summary(select.stats(predict(sims1), parameter = 'sigma')  )

Run the code above in your browser using DataLab