ss_modelselect: Select a best-fit linear model for one species

View source: R/ss_modelselect.R

ss_modelselectR Documentation

Select a best-fit linear model for one species

Description

Select a best-fit equation for one species, based on the lowest bias-corrected Aikaike’s information criterion (AICc).

Usage

ss_modelselect(data, response = "height", predictor = "diameter")

Arguments

data

Dataframe that contains the variables of interest. Each row is a measurement for an individual tree.

response

Column name of the response variable. Defaults to height.

predictor

Column name of the predictor variable. Defaults to diameter.

Details

All allometric equations considered (and ranked) can be found in ?eqns_info and data(eqns_info). To make the AICc values of equations with a transformed response variable comparable to untransformed equations, log(y_{i}) is multiplied by the geometric mean of the response variable in data.

Value

A list of 3 elements:

all_models_rank

Table showing models ranked by AICc value.

best_model

Best-fit model object.

best_model_info

Table showing information on the best-fit model.

best_model_info

A dataframe with the following variables:

modelcode

Model code for the best-fit equation.

a, b, c, d, e

Parameter estimates.

response_geom_mean

Geometric mean of the response variable used in calculation of AICc (only for transformed models).

correctn_factor

Bias correction factor to use on model predictions (only for transformed models).

predictor_min, predictor_max

Range of the predictor variable within the data used to generate the model.

response_min, response_max

Range of the response variable within the data used to generate the model.

residual_SE

Residual standard error of the model.

mean_SE

Mean standard error of the model.

adj_R2

Adjusted R^2 of the model.

n

Sample size (no. of trees used to fit model).

References

McPherson E. G., van Doorn N. S. & Peper P. J. (2016) Urban Tree Database and Allometric Equations. General Technical Report PSW-GTR-253, USDA Forest Service, 86.

Xiao, X., White, E. P., Hooten, M. B., & Durham, S. L. (2011). On the use of log-transformation vs. nonlinear regression for analyzing biological power laws. Ecology, 92(10), 1887–1894.

Burnham, K. P., & Anderson, D. R. (2004). Multimodel inference: Understanding AIC and BIC in model selection. Sociological Methods and Research, 33(2), 261–304.

See Also

ss_modelselect_multi() to select best-fit models across multiple species.

ss_modelfit() to fit a pre-selected model for one species.

ss_modelfit_multi() to fit pre-selected models across multiple species.

Other single-species model functions: ss_modelfit_multi(), ss_modelfit(), ss_modelselect_multi(), ss_predict(), ss_simulate()

Examples

data(urbantrees)
Alb_sam <- urbantrees[urbantrees$species == 'Albizia saman', ]  # subset data for 1 species
results <- ss_modelselect(Alb_sam, response = 'height', predictor = 'diameter')

head(results$all_models_rank)

results$best_model

results$best_model_info


xp-song/allometree documentation built on March 28, 2022, 4:36 a.m.