Title: | Extended HOF (Huisman-Olff-Fresco) Models |
---|---|
Description: | Extended and enhanced hierarchical logistic regression models (called Huisman-Olff-Fresco in biology, see Huisman et al. 1993 Journal of Vegetation Science <doi:10.1111/jvs.12050>) models. Response curves along one-dimensional gradients including no response, monotone, plateau, unimodal and bimodal models. |
Authors: | Florian Jansen [aut, cre], Jari Oksanen [aut] |
Maintainer: | Florian Jansen <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.16 |
Built: | 2025-02-13 02:41:43 UTC |
Source: | https://github.com/cran/eHOF |
Species and Environmental Data from arable fields in North-Eastern Germany. The data contains 100 selected plots (rows) and 6 species (columns).
data(acre)
data(acre)
Two data frames, one data frame called acre
with 100 vegetation plots (rows).
Species are named with 7 letter shortletters according to the taxonomic reference list GermanSL.
Plant performance is given as presence-absence. The second data frame, named acre.env
consists of
plot information about date of survey, survey area, total plant cover and measured soil pH.
Soil pH was measured in 1-mol KCl buffer solution.
Manthey, M. (2003). Vegetations\"okologie der \"Acker und Ackerbrachen Mecklenburg-Vorpommerns. 209 p., Berlin [u.a.]: Cramer.
data(acre) hist(acre.env$PH_KCL) ## Not run: vignette('eHOF', 'eHOF') ## End(Not run)
data(acre) hist(acre.env$PH_KCL) ## Not run: vignette('eHOF', 'eHOF') ## End(Not run)
Automatic version of function layout
for given number of subplots. Defined matrix schemes for layout
for up to 32 subfigures.
autolayout(N, byrow = TRUE, ...)
autolayout(N, byrow = TRUE, ...)
N |
number of subfigures |
byrow |
see matrix |
... |
Number of figures, N, see layout.
for(i in sample(1:32, 1)) { autolayout(i, byrow=TRUE) layout.show(i) }
for(i in sample(1:32, 1)) { autolayout(i, byrow=TRUE) layout.show(i) }
Generating beta response models. Implemented to compare the hierarchical logistic regression models with beta response models.
betaresp(x, p1, p2, alpha, gamma, hi)
betaresp(x, p1, p2, alpha, gamma, hi)
x |
Gradient values |
p1 , p2
|
response endpoints |
alpha , gamma
|
shape parameters of the response |
hi |
maximum height of response |
Jari Oksanen
x <- seq(0,3, len=201) m <- betaresp(x, 2, 0.8, 0.1, 0.5, 0.8) plot(m)
x <- seq(0,3, len=201) m <- betaresp(x, 2, 0.8, 0.1, 0.5, 0.8) plot(m)
Extended and enhanced hierarchical logistic regression models (called Huisman-Olff-Fresco in biology, see Huisman et al. 1993 Journal of Vegetation Science <doi:10.1111/jvs.12050>) models. Response curves along one-dimensional gradients including no response, monotone, plateau, unimodal and bimodal models.
Jansen, F., Dengler, J (2011) Plant names in vegetation databases - a neglected source of bias, Journal of vegetation science, 21(6), 1179-1186. http://dx.doi.org/10.1111/j.1654-1103.2010.01209.x
Species and Environmental Data from Mt. Field, Tasmania. The acre
data frame has 100 selected sites (rows)
and 6 species (columns).
Data frame mtf.env
has only one variable: Altitude
above sea level (in meters) for each site.
The data are a subset of well drained sites from a more extensive data set.
data(mtf)
data(mtf)
The species data frame contains the following species:
a numeric vector
a numeric vector
a numeric vector
a numeric vector
a numeric vector
Minchin, P.R. (1989). Montane vegetation of the Mt. Field massif, Tasmania: a test of some hypotheses about properties of community patterns. Vegetatio 83, 97.110.
data(mtf)
data(mtf)
Derive common shape parameters from the different model types. Calculate a set of parameters (see values below) from eHOF models.
Para(resp, ...) ## S3 method for class 'HOF' Para(resp, model, newdata = NULL, ...)
Para(resp, ...) ## S3 method for class 'HOF' Para(resp, model, newdata = NULL, ...)
resp |
response model results, see [HOF()] |
... |
further arguments passed to or from other methods, e.g. for [pick.model()] |
model |
response model type. If not specified, the output of [pick.model()] will be used |
newdata |
vector of gradient values to use |
For models VI and VII Para
will give you two expectancy values for the ranges left and right of the pessimum between the model optima. If you want to have the overall expectancy value, use:
gradient <- seq(min(Para(resp)$range), max(Para(resp)$range), length.out=10000)
weighted.mean(gradient, predict(resp, newdata=gradient))
* species Name or abbreviat of the species.
* abund sum Abundance sum, i.e. sum of all response values divided by M.
* range Range of x values.
* model Model type, if not specified the result of [pick.model].
* para Model parameters (a to d).
* M Maximum response value, specified in the HOF function call.
* mini Location of the minimum, i.e. the gradient value, where the response is lowest, for model VI and VII the lowest response between the two optima.
* pess Lowest estimated response value.
* top Highest estimated response value(s).
* opt Location of the optimum, i.e. the gradient value, where the species response is highest. NA for model I and an optimum interval for model type III.
* expect Expectancy value, i.e. average x value under the model curve).
* max slope Highest slope, i.e. maximum of the first derivation of the curve.
* centralBorder Following Heegard, the central borders are calculated as the gradient values, where the response reaches "exp(-1/2)"
of the top.
* outerBorder Following Heegard, the outer borders of the species niche are calculated as the gradient values, where the response reaches exp(-2)
of the top.
* raw mean Average of measured x values.
Florian Jansen
Heegard, E. (2002) The outer border and central border for species-environmental relationships estimated by non-parametric generalised additive models. Ecological Modelling, 157, 131-139.
Damgaard, C. (2006) Modelling ecological presence-absence data along an environmental gradient: threshold levels of the environment. Environ Ecol Stat 13:229-236.
Slope and inflection points for the eHOF model types.
Para_deriv( resp, newdata = NULL, model = NULL, p, type = c("slope", "inflection"), ... )
Para_deriv( resp, newdata = NULL, model = NULL, p, type = c("slope", "inflection"), ... )
resp |
response model results, see [HOF()]. |
newdata |
new gradient vector, if NULL a vector with 10000 values within gradient range will be used. |
model |
response model type. If not specified, the output of [pick.model()] will be used. |
p |
Vector of model parameters. If not specified, resp$models[[model]]$par will be used. |
type |
Output type: slope or inflection points of model curves. |
... |
further arguments passed to or from other methods, e.g. for [pick.model()]. |
For slope a vector of slopes for all newdata points. Inflection points are the extremes of the second derivative.
Florian Jansen
Peper, J., Jansen, F., Pietzsch, D., Manthey, M. 2011. Patterns of plant species turnover along grazing gradients. Journal of Vegetation Science 22: 457–466.
Plot single or multiple HOF models with or without model parameters.
## S3 method for class 'HOF' plot( x, marginal = c("bar", "rug", "hist", "points", "n"), boxp = TRUE, las.h = 1, yl, main, model, test = "AICc", modeltypes, onlybest = TRUE, penal, gam = FALSE, selectMethod, silent = FALSE, para = FALSE, gam.se = FALSE, color, newdata = NULL, lwd = 1, leg = TRUE, add = FALSE, xlabel, ... )
## S3 method for class 'HOF' plot( x, marginal = c("bar", "rug", "hist", "points", "n"), boxp = TRUE, las.h = 1, yl, main, model, test = "AICc", modeltypes, onlybest = TRUE, penal, gam = FALSE, selectMethod, silent = FALSE, para = FALSE, gam.se = FALSE, color, newdata = NULL, lwd = 1, leg = TRUE, add = FALSE, xlabel, ... )
x |
an object from |
marginal |
type of marginal representation for occurrences/absences. |
boxp |
plotting of horizontal boxplots |
las.h |
orientation of axes labels (0 = vertical, 1 = horizontal) |
yl |
range of y axis, useful for rare species. Must be given as fraction of M (between 0 and 1). |
main |
optional plot title |
model |
specific HOF model used, if not selected automatically. |
test |
See |
modeltypes |
vector of suggested model types |
onlybest |
plot only the best model according to chosen Information criterion. If set to FALSE all calculated models will be plotted, but the best model with a thicker line. |
penal |
penalty term for model types, default is the number of model parameter |
gam |
plot Generalized additive response |
selectMethod |
See |
silent |
Print messages |
para |
should model parameters (optima, raw.mean, niche,..) be plotted. |
gam.se |
plotting of two times standard error of predict.gam as confidence interval |
color |
model line color, vector of length seven |
newdata |
curves are plotted for original x-values. Otherwise you have to provide a vector with new gradient values. |
lwd |
line width of model curve(s) |
leg |
legend for model type (and parameters) |
add |
add to existing plot |
xlabel |
x axis label |
... |
further arguments passed to or from other methods. |
Plottype layout
will give a normal plot for a single species, or if the HOF object contains several species,
the graphics display will be divided by autolayout
. Multiple species can also be plotted by a lattice
xyplot and plotted with plot.HOF for every species. The third option (plottype='all') plots all selected species
on the same graph which might be useful to evaluate e.g. the species within one vegetation plot, see examples.
A rug
adds a rug representation (1-d plot) of the data to the plot. A rug plot is a compact way of
illustrating the marginal distributions of x. Positions of the data points along x and y are denoted by tick marks,
reminiscent of the tassels on a rug. Rug marks are overlaid onto the axis.
A dit='bar'
plot will display the original response values. For binary data this will be identical to rug.
Florian Jansen
de la Cruz Rot M (2005) Improving the Presentation of Results of Logistic Regression with R. Bulletin of the Ecological Society of America 86: 41-48
[HOF()]
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) par(mar=c(2,2,1,.1)) plot(mo, para=TRUE) #' An example for plottype='all' to show species responses for the species within #' the most acidic and the most calcareous vegetation plot. ## Not run: allSpeciesFromAnAcidicPlot <- acre['57',] > 0 mods.acidic <- HOF(acre[,allSpeciesFromAnAcidicPlot],acre.env$PH_KCL,M=1,bootstrap=NULL) allSpeciesFromAnCalcareousPlot <- acre['87',] > 0 mods.calc <- HOF(acre[,allSpeciesFromAnCalcareousPlot],acre.env$PH_KCL,M=1,bootstrap=NULL) autolayout(2) plot(mods.acidic, plottype='all', main='Plot with low pH') abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == '57']) names(mods.acidic) plot(mods.calc, plottype='all', main='Plot with high pH') abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == '87']) names(mods.calc) ## End(Not run)
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) par(mar=c(2,2,1,.1)) plot(mo, para=TRUE) #' An example for plottype='all' to show species responses for the species within #' the most acidic and the most calcareous vegetation plot. ## Not run: allSpeciesFromAnAcidicPlot <- acre['57',] > 0 mods.acidic <- HOF(acre[,allSpeciesFromAnAcidicPlot],acre.env$PH_KCL,M=1,bootstrap=NULL) allSpeciesFromAnCalcareousPlot <- acre['87',] > 0 mods.calc <- HOF(acre[,allSpeciesFromAnCalcareousPlot],acre.env$PH_KCL,M=1,bootstrap=NULL) autolayout(2) plot(mods.acidic, plottype='all', main='Plot with low pH') abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == '57']) names(mods.acidic) plot(mods.calc, plottype='all', main='Plot with high pH') abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == '87']) names(mods.calc) ## End(Not run)