Learn R Programming

eHOF (version 1.15)

HOF.data.frame: Hierarchical logistic regression

Description

Fit seven hierarchical logistic regression models and select the most appropriate model by information criteria and a bootstrap approach to guarantee model stability. The first five shapes are known as Huisman-Olff-Fresco (HOF) models in ecology (Huisman et al. 1993). Additionally the package provides two bimodal shapes.

Usage

# S3 method for data.frame
HOF(veg, grad, M = max(veg), freq.limit = 10, ...)

HOF(...)

# S3 method for default HOF( occ, grad, M = max(occ), y.name, family = binomial, lim = 100, bootstrap = 100, test = c("AICc", "BIC", "AIC", "Dev"), modeltypes = eHOF.modelnames, ... )

# S3 method for HOF coef(object, model, ...)

# S3 method for HOF deviance(object, model, ...)

# S3 method for HOF fitted(object, model, ...)

# S3 method for HOF predict(object, model, newdata, ...)

pick.model(...)

# S3 method for HOF pick.model( object, level = 0.95, test = c("AICc", "BIC", "AIC", "Dev"), modeltypes, penal = "df", gam = FALSE, selectMethod = c("bootselect.lower", "bootselect.always", "IC.weight", "pick.model"), silent = FALSE, ... )

# S3 method for list pick.model.HOF(object, ...)

Value

HOF.fit returns an object of class "HOF" which contains the parameters of the call, the fitting results for every model type and a vector of chosen model types from bootstrapping.

Arguments

veg

vegetation data frame. Either as matrix with species in columns and plots in rows, or in Turboveg format.

grad

gradient data vector.

M

maximum attainable value in the HOF model, similar to binomial denominator.

freq.limit

lowest frequency of species analysed.

...

further arguments passed to or from other methods

occ

species occurrences (=response) vector.

y.name

name of the species.

family

error distribution. Alternatives are binomial, poisson and gaussian.

lim

limiting criterion for minimization function, see details.

bootstrap

number of bootstrap samplings to check model robustness, see details.

test

information criterion for model selection. Alternatives are "AICc", "BIC", "AIC" or just "Dev"iance.

modeltypes

vector of model types, when only a subset of the seven implemented modeltypes should be considered.

object

HOF model object, results from function HOF. Either for a single species or a list for several species.

model

You can specify the HOF model type to be used, otherwise it is selected through function [pick.model()].

newdata

vector of gradient values to use

level

probability for model selection (1-P) for F or Chisq tests.

penal

penalty term for model types, default is the number of model parameter.

gam

calculate AIC of GAM model and compare it with HOF models.

selectMethod

choose the model type selection method in case of divergence of the most frequent bootstrapped model or the one with highest information criterion weight from the primary chosen type.

silent

messages about selectMethod

Author

Florian Jansen, Jari Oksanen

Details

The minimization function changed compared to package gravy (Oksanen 2002) from nlm to nlminb to be able to set a limit for estimated parameters (default= -100 to 100). The old models III and V have been often too sharp, lim=Inf will produce results similar to gravy. Function [pick.model()] finds the most adequate modeltype according to the chosen Information Criterion (AICc is default). Function fitted returns the fitted values for the used gradient, and predict for any values in newdata.

To improve and check model stability a bootstrapping mechanism is implemented in function HOF. If the initially chosen model type is different from the most frequent one, the latter will be chosen by default. Bootstrapping is done with sample(length(grad), replace = TRUE).

References

Jansen, F. & Oksanen, J. (2013) What shape are species responses along ecological gradients? - Huisman-Olf-Fresco models revisited. Journal of Vegetation Science, DOI: 10.1111/jvs.12050

Oksanen, J. & Minchin, P.R. (2002). Continuum theory revisited: what shape are species responses along ecological gradients? Ecological Modelling 157, 119-129.

Huisman, J., Olff, H. & Fresco, L.F.M. (1993). A hierarchical set of models for species response analysis. Journal of Vegetation Science 4, 37-46.

See Also

[plot.HOF()] provides advanced plotting schemes for HOF models. [Para()] derives model parameters like optimum, niche (width), slope etc.

Examples

Run this code
  data(acre)
  sel <- c('MATRREC', 'RUMEACT', 'SILENOC', 'APHAARV', 'MYOSARV', 'DESUSOP', 'ARTE#VU')
  mo <- HOF(acre[,match(sel, names(acre))], acre.env$PH_KCL, M=1, bootstrap=NULL)
  mo

Run the code above in your browser using DataLab