mix_modelselect: Fit linear mixed-effects model across all species

View source: R/mix_modelselect.R

mix_modelselectR Documentation

Fit linear mixed-effects model across all species

Description

Fit data to linear mixed-effects model with 'species' specified as the random effect, using the lme4::lmer function under the hood. The full list of allometric equations that are considered can be found in ?eqns_info and data(eqns_info).

Usage

mix_modelselect(
  data,
  species = "species",
  response = "height",
  predictor = "diameter"
)

Arguments

data

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

species

Column name of the species variable in data. Defaults to species.

response

Column name of the response variable. Defaults to height.

predictor

Column name of the predictor variable. Defaults to diameter.

Value

A list of 5 elements:

models_rank

A model selection table of all the types of mixed-effects models considered, ranked in order of ascending Aikake's Information Criterion corrected for small sample sizes (AICc). Model details can be found in ?eqns_info and data(eqns_info).

best_model

The best-fit model object.

R2

The conditional and marginal pseudo-R^2 of the best-fit model.

CF

Correction factor used to adjust predicted values if response variable is transformed (incorporated into reported parameters).

warnings

Warning messages, if any, spit from the models. These usually indicate failure of model convergence.

See Also

Other mixed-effects model functions: mix_predict(), mix_simulate()

Examples

data(urbantrees)

## Not run: 
mix_modelselect(data = urbantrees,
                species = "species",
                response = "height", predictor = "diameter")

## End(Not run)


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