A functionalised version of code developed by Statistics Netherlands (see source). See `msi` for a wrapper that removes the need to write files to a folder first. Multi-Species Indicators (MSI) are biodiversity indicators that combine the population development of species into a single indicator. The MSI-tool calculates an MSI, confidence intervals for the MSIs and linear and flexible (smoothed) trends. The trends are classified in terms like "moderate increase", "strong decrease" or "stable". A number of additional analyses can be performed like testing for changepoints, comparison of trends before and after a changepoint and the calculation and testing of the total change in a time series.
Usage
msi_tool(
wd = getwd(),
inputFile,
jobname = "MSI_job",
nsim = 1000,
SEbaseyear = NULL,
plotbaseyear = NULL,
index_smooth = "SMOOTH",
span = 0.75,
lastyears = 10,
maxCV = 3,
changepoint = NULL,
truncfac = 10,
TRUNC = 1,
plot = TRUE
)
Arguments
- wd
The path for input and ouput files
- inputFile
The name of the input file. This must have columns species, year, index, se in that order. The index value in the base year (which need not be the first year), should be set to 100 with se of 0.
- jobname
Generic name for output files
- nsim
Number of Monte Carlo simulations
- SEbaseyear
Desired year to set MSI to 100 and SE to 0; usually the first year of the time series
- plotbaseyear
desired year to set to 100 in plots
- index_smooth
A character, either 'INDEX' or 'SMOOTH'. "INDEX" will cause the index in plotbaseyear set to 100; "SMOOTH" will set the smoothed trend value in the plotbaseyear to 100.
- span
Span is the proportion of points to use in the weighted estimation of the smoothed line. Values close to 1 are more smoothed than values close to 0
- lastyears
last X years of time series for which separate trend (short-term trends) should be calculated
- maxCV
maximum allowed mean Coefficient of Variation (CV) of species indices (0.5 = 50 Species with higher mean CV are excluded.
- changepoint
compare trends before and after this year
- truncfac
truncation factor (=max year-to-year index ratio). Default for Living Planet Index = 10.
- TRUNC
set all indices below TRUNC to this value and their SE to 0. TRUNC = 0 means no truncation.
- plot
logical, should plots be created