index: Calculate indices of abundance and productivity from CES data

View source: R/index.R

indexR Documentation

Calculate indices of abundance and productivity from CES data

Description

Takes a CES object created by extract.data and, depending on what data are available, creates indices of the number of adults and juveniles caught and the ratio of the two, as an index of productivity.

Usage

index(cesdata, year=-1, begin=0, smooth=FALSE, random=FALSE, trend=0, compare=0, verbose=FALSE, visit.corr=TRUE, cl=0.95)

Arguments

cesdata

A CES dataset create by extract.data

year

A year to act as reference year, i.e. in which the index is value is 1

begin

The first year for which the trend should be calculated from. May be useful if a species is not common in the first years of the dataset, but becomes so subsequently.

visit.corr

Logical, include the correction for missing visits when calculating indices?

cl

Width of confidence limits. 0.95 is default, 0.83 limits don't overlap with (approximate) probability 0.95, so may be useful when comparing (or graphing) values of the index in specific years.

smooth

An indicator value to determine if smoothed trends should be calculated. These are fitted with mgcv::gam so using a thin-plate spline and the degree of 'wiggliness' will be determined by the data.

random

An indicator value to determine if site and year should instead be fitted as random effects (~(1|site) + (1|year) + (1|site:year)), with both site and year as factors (only).

trend

An integer to indicate how many years to calculate a linear trend over. The last year of the trend will always be the last year in the dataset. If trend is greater than the number of years available then a simple linear trend will be fitted.

compare

An integer to indicate how many years to compare the last year to. Thus if compare=5 and the last year is 2008 then the index value for 2008 will be compared to the average values for 2003-2007 (which will be set to 1). Earlier years will be modelled as annual fixed-effects.

verbose

Logical. If TRUE then the annual estimates will be printed, if FALSE then a summary test will be printed.

Details

Uses data from sites covered in more than one year.

Value

A list with some or all of the following components

ad.results

Model fit information for adult birds

jv.results

Model fit information for juvenile birds

ad.results

Model fit information for adult birds

Each of these three consists of three components: model - a glm object containing the model fit; parms - a dataframe containing the annual year parameter estimates; and test - a list containing either the results of statistical tests generated by using compare or trend, or additional model information if smooth= or random=TRUE.

model.type

a list containing the type of model fitted (type), the reference year (refyear) and the number of years over which any trend or comparison are fitted (nyrs)

spp

Euring species code

spp.name

Name of the species in whichever language has been set by setceslang

Author(s)

Rob Robinson

Examples

data(ukdata)
plots <- extract.coverage(ukdata)
robin.dat <- extract.data(ukdata, species=10990, plots=plots)
result <- index(robin.dat, verbose=TRUE)
res.lin <- index(robin.dat, trend=5)

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