Learn R Programming

sars (version 1.0.0)

sar_multi: Fit a multimodel SAR curve

Description

Construct a multimodel species-area relationship curve using information criterion weights and up to twenty SAR models.

Usage

sar_multi(data, obj = c("power",
  "powerR","epm1","epm2","p1","p2","expo","koba",
  "mmf","monod","negexpo","chapman","weibull3","asymp",
  "ratio","gompertz","weibull4","betap","heleg", "linear"), crit = "Info",
  normaTest = "lillie", homoTest = "cor.fitted", neg_check = TRUE,
  alpha_normtest = 0.05, alpha_homotest = 0.05, confInt = FALSE, ciN = 100,
  verb = TRUE)

Arguments

data

A dataset in the form of a dataframe with two columns: the first with island/site areas, and the second with the species richness of each island/site.

obj

Either a vector of model names or a fit_collection object.

crit

The criterion used to compare models and compute the model weights. The default crit = "Info" switches to AIC or AICc depending on the number of data points in the dataset. For BIC, use crit = "Bayes".

normaTest

The test used to test the normality of the residuals of each model. Can be any of "lillie" (Lilliefors Kolmogorov-Smirnov test; the default), "shapiro" (Shapiro-Wilk test of normality), "kolmo" (Kolmogorov-Smirnov test), or "none" (no residuals normality test is undertaken).

homoTest

The test used to check for homogeneity of the residuals of each model. Can be any of "cor.fitted" (a correlation of the residuals with the model fitted values; the default), "cor.area" (a correlation of the residuals with the area values), or "none" (no residuals homogeneity test is undertaken).

neg_check

Whether or not a check should be undertaken to flag any models that predict negative richness values.

alpha_normtest

The alpha value used in the residual normality test (default = 0.05, i.e. any test with a P value < 0.05 is flagged as failing the test).

alpha_homotest

The alpha value used in the residual homogeneity test (default = 0.05, i.e. any test with a P value < 0.05 is flagged as failing the test).

confInt

A logical argument specifying whether confidence intervals should be calculated for the multimodel curve using bootstrapping.

ciN

The number of bootstrap samples to be drawn to calculate the confidence intervals (if confInt == TRUE).

verb

verbose (default: verb == TRUE).

Value

A list of class "multi" and class "sars" with two elements. The first element ('mmi') contains the fitted values of the multimodel sar curve. The second element ('details') is a list with the following components:

  • mod_names Names of the models that were successfully fitted and passed any model check

  • fits A fit_collection object containing the successful model fits

  • ic The information criterion selected

  • norm_test The residual normality test selected

  • homo_test The residual homogeneity test selected

  • alpha_norm_test The alpha value used in the residual normality test

  • alpha_homo_test The alpha value used in the residual homogeneity test

  • ics The information criterion values (e.g. AIC values) of the model fits

  • delta_ics The delta information criterion values

  • weights_ics The information criterion weights of each model fit

  • n_points Number of data points

  • n_mods The number of successfully fitted models

  • no_fit Names of the models which could not be fitted or did not pass model checks

The summary.sars function returns a more useful summary of the model fit results, and the plot.multi plots the multimodel curve.

Details

The multimodel SAR curve is constructed using information criterion weights (see Burnham & Anderson, 2002; Guilhaumon et al. 2010). If obj is a vector of n model names the function fits the n models to the dataset provided. A dataset must have four or more datapoints to fit the multimodel curve. If any models cannot be fitted they are removed from the multimodel SAR. If obj is a fit_collection object, any model fits in the collection which are NA are removed. In addition, if any other model checks have been selected (i.e. residual normality and heterogeneity tests, and checks for negative predicted richness values), these are undertaken and any model that fails the selected test(s) is removed from the multimodel SAR. The order of the additional checks inside the function is: normality of residuals, homogeneity of residuals, and a check for negative fitted values. Once a model fails one test it is removed and thus is not available for further tests. Thus, a model may fail multiple tests but the returned warning will only provide information on a single test.

The resultant models are then used to construct the multimodel SAR curve. For each model in turn, the model fitted values are multiplied by the information criterion weight of that model, and the resultant values are summed across all models (Burnham & Anderson, 2002). Confidence intervals can be calculated (using confInt) around the multimodel averaged curve using the bootstrap procedure outlined in Guilhaumon et al (2010).The procedure transforms the residuals from the individual model fits and occasionally NAs / Inf values can be produced - in these cases, the model is removed from the confidence interval calculation (but not the multimodel curve itself). When several SAR models are used and the number of bootstraps (ciN) is large, generating the confidence intervals can take a long time.

References

Burnham, K. P., & Anderson, D. R. (2002). Model selection and multi-model inference: a practical information-theoretic approach (2nd ed.). New-York: Springer.

Guilhaumon, F., Mouillot, D., & Gimenez, O. (2010). mmSAR: an R-package for multimodel species-area relationship inference. Ecography, 33, 420-424.

Examples

Run this code
# NOT RUN {
data(galap)
#attempt to construct a multimodel SAR curve using all twenty sar models
fit <- sar_multi(galap)
summary(fit)
plot(fit)

# construct a multimodel SAR curve using a fit_collection object
s1 <- sar_power(galap)
s2 <- sar_expo(galap)
s3 <- sar_koba(galap)
ff <- fit_collection(s1, s2, s3)
fit2 <- sar_multi(galap, obj = ff)
summary(fit2)

# construct a multimodel SAR curve without conducting any model checks
fit3 <- sar_multi(galap, normaTest = "none", homoTest = "none", neg_check = FALSE)

# }

Run the code above in your browser using DataLab