ces.table: Create a table of results for a list of species

View source: R/ces.table.R

ces.tableR Documentation

Create a table of results for a list of species

Description

Runs a specified set of models (see details) for a list of species and present the results in a table.

Usage

ces.table(cesobj, species=NA, columns=c("A-1", "P-1", "S-1"), base=100, plots=NULL, min.n=100, min.ch=50, ndigits=2, year=-1, change=FALSE, visit.corr=TRUE, save.results=FALSE)

Arguments

cesobj

a CES dataframe typically generated by readces.

species

a numeric vector of Euring species codes, these can be checked using get.euring, if missing use min.n=.

columns

a character vector specifying which models should be applied to each species, see details.

base

which number should indicate no change: 0, 1, or 100?

plots

an object containing plot coverage data created by extract.coverage. If missing one will be created containing all sites and years.

min.n

if species is not specified, include all species with more than this number of captures.

min.ch

for survival models, how many individuals need to be captured for a site to be included, see extract.ch. Can be either an integer, or a vector the same length as species.

ndigits

numeric, how many decimal places to round the results to, see note.

year

the reference year for the comparisons if not the last.

change

logical, for comparison models return the change or the relative value (e.g. +0.2 or 1.2); for trend models TRUE gives the overall change, FALSE the (annual) slope.

visit.corr

logical, include an offset for missed visits in the models, see index.

save.results

logical, save the full model results, or only the annual values. Setting this to TRUE can result in a quite a large object, so it may be helpful to skip these.

Details

Models are specified using three characters: (i) the parameter ('A'dult and 'J'uvenile numbers, 'P'roductivity and 'S'urvival, (ii) the model type, currently either '-' to compare to previous years or '/' for a trend, and (iii) the number of (previous) years over which the comparison or trend should be calculated. Thus, for example. "A-5" would compare the current year's estimate of adult captures to the previous 5 years, see index for more details on this. The default is to compare with the previous year ("-1").

For change ('-') models the estimates will be either be the index relative to the base value (so -0.15, 0.85, or 85.0 for base = 0, 1, 100 respectively) or the relevant change (if change=TRUE then -0.15, -0.15, 15.0 in those instances). For trend ('/') models the estimate will be a slope (mean annual change), on either the log (abundance) or logit (survival/productivity) scale (and might be expressed as either 0.07 or 7.00, for example, depending on whether or not base=100).

A simple table will be printed with the change/trend estimate (along with confidence limits and an indication of significance) for each model (columns) and species (rows). These numbers are returned as a dataframe, see 'value' below.

Value

a list with three components: table - a dataframe that mimics the printed table, so in 'wide' format; estimates - a dataframe in 'long' format, one row per entry; results - a named list of the model objects, in the form "T_xxxxx_mmm", where xxxxx is the Euring code number, mmm the model specification.

Note

ndigits is strict, the returned 'estimates' dataframe will be rounded to this level as well.

Author(s)

Rob Robinson

See Also

index

Examples

## Not run: 
# compare adult numbers in the current yaer to the previous year, 
# survival with the previous five years and a 10-year trend in productivity 
results <- ces.table(ukdata, columns=c('A-0', 'S-5', 'P/10'))

## End(Not run)

btorobrob/cesr documentation built on June 9, 2025, 5:39 a.m.