Learn R Programming

indicspecies (version 1.7.6)

predict.indicators: Predicts site group from indicators

Description

Determines the probability of the indicated site group given a new community data set.

Usage

# S3 method for indicators
predict (object, newdata,...)

Arguments

object

An object of class 'indicators'.

newdata

A community data table (with sites in rows and species in columns) for which predictions are needed. This table can contain either presence-absence or abundance data, but only presence-absence information is used for the prediction.

...

Additional arguments not used (included for compatibility with predict).

Value

If confidence intervals are available in x, the function returns a matrix where communities are in rows and there are three columns, correspoinding to the probability of the indicated site group along with the confidence interval. If confidence intervals are not available in x, then the function returns a single vector with the probability of the indicated site group for each community.

Details

Function indicators explores the indicator value of the simultaneous occurrence of sets of species (i.e. species combinations). The method is described in De C<U+00E1>ceres et al. (2012) and is a generalization of the Indicator Value method of Dufr<U+00EA>ne & Legendre (1997). The current function predict.indicators is used to predict the indicated site group from the composition of a new set of observations. For communities where one or more of the indicator species combinations are found, the function returns the probability associated to the indicator that has the highest positive predictive value (if confidence intervals are available, the maximum value is calculated across the lower bounds of the confidence interval). For communities where none of the indicator species combinations is found, the function returns zeroes.

References

De C<U+00E1>ceres, M., Legendre, P., Wiser, S.K. and Brotons, L. 2012. Using species combinations in indicator analyses. Methods in Ecology and Evolution 3(6): 973-982.

Dufr<U+00EA>ne, M. and P. Legendre. 1997. Species assemblages and indicator species: The need for a flexible asymetrical approach. Ecological Monographs 67:345-366.

See Also

indicators, pruneindicators coverage, multipatt, strassoc, signassoc

Examples

Run this code
# NOT RUN {
library(stats)

data(wetland) ## Loads species data

## Creates three clusters using kmeans
wetkm = kmeans(wetland, centers=3) 

## Determine sensitivity of individual species
B=strassoc(wetland, cluster=wetkm$cluster,func="B") 

## Select species with more than 20% of sensitivity for the first group
sel=which(B[,1]>0.2) 

## Run indicator analysis with species combinations for the first group
sc= indicators(X=wetland[,sel], cluster=wetkm$cluster, group=1, verbose=TRUE, At=0.5, Bt=0.2)

## Use the indicators to make predictions 
## (normally an independent data set will be used)
p<-predict(sc, wetland)

## Show original groups with prediction for group 1
print(data.frame(wetkm$cluster,p))

# }

Run the code above in your browser using DataLab