calculateIndex: Calculate Index

View source: R/calculateIndex.R

calculateIndexR Documentation

Calculate Index

Description

Calculate the Nature Index for a major habitat, or calculate a thematic index.

Usage

calculateIndex(x = NULL, imputations = NULL, awBSunit = NULL, nsim = 1000, ...)

Arguments

x

list of class niInput.

imputations

optional list of class niImputations.

awBSunit

character, name of variable in x$BSunit used to calculate NIunit weights.

nsim

integer - number of bootstrap simulations, default is 1000.

...

further arguments passed on to calculateBSunitWeights (fids, tgroups, keys, w), calculateNIunitWeights (awbs, awBSunit), and scaleObsMat (truncAtRef).

Details

A time series of index values are calculated for each of one or more NIunits. NIunits as well as years included in the time series are specified in x.

Index calculations and associated terminology are explained in the vignette NatureIndexCalculation.

calculateIndex produces an extensive output for each index value to facilitate further analyses of the results. In addition to a sample of nsim draws of the index estimate, output includes data describing indicators, ICunits, and BSunits included in the input data set, imputations if present in the data, weights per combination of BSunits and indicators, calculation parameters etc.

The vignette objectsInNIcalc gives a detailed description of output objects generated by calculateIndex and provides an overview of methods developed for niOutput, niSeries, and niValue classes.

Value

calculateIndex returns a list of class niOutput where each list element is itself a list of class niSeries containing the index results for an NIunit. Each element of an niSeries list again is a list of class niValue. Objects of class niValue contain the results from the calculation of a single Nature Index or thematic index value.

Author(s)

Bård Pedersen

See Also

niInput and niImputations for more detailed description of input data, niOutput for more detailed description of class niOutput objects.
The following methods are available within NIcalc to display and summarize results produced by calculateIndex: summary.niOutput, summary.niSeries, plot.niSeries, summaryWeights, plot.niValue, and plotWeights.
calculateIndex calls a series of other functions within NIcalc: calculateBSunitWeights, calculateNIunitWeights, calculateWeights, sampleObsMat,scaleObsMat, indexCalculation, and indexCalculationPerBSunit.

Examples

## Not run: 
# Calculation of a thematic index:

themeImputes <- imputeData(x = themeData,
                               nSim = 1000,
                               transConst = 0.01,
                               maxit = 20,
                               printFlag = TRUE)
carnivoreIndex <- calculateIndex(x = themeData,
                                 imputations = themeImputes,
                                 nsim = 1000,
                                 fids = FALSE,
                                 tgroups = FALSE,
                                 keys = "ignore",
                                 w = 0,
                                 awbs = TRUE,
                                 awBSunit = "Skog")

## End(Not run)


NINAnor/NIcalc documentation built on Oct. 26, 2023, 9:37 a.m.