ss_modelfit_multi | R Documentation |
Wrapper function that runs ss_modelfit()
across multiple species. Data is
fit to specified allometric equations for each species, as defined within
ref_table
. The full list of allometric equations that may be considered in
ref_table
can be found in ?eqns_info
and data(eqns_info)
.
ss_modelfit_multi( data, ref_table, species = "species", modelcode = "modelcode", response = "height", predictor = "diameter" )
data |
Dataframe that contains the variables of interest. Each row is a measurement for an individual tree of a particular species. |
ref_table |
Dataframe containing an allometric equation for each tree species, in the form of a model code. Each row is a unique species. |
species |
Column name of the species variable in both the dataframes
|
modelcode |
Column name containing the model codes in |
response |
Column name of the response variable in |
predictor |
Column name of the predictor variable in |
A list of 2 elements:
List of each species' resulting model object.
Table showing each species' resulting model information.
A dataframe with the following variables:
Name of tree species.
Model code for the allometric equation used.
Parameter estimates.
Geometric mean of the response variable used in calculation of AICc (only for transformed models).
Bias correction factor to use on model predictions (only for transformed models).
Range of the predictor variable within the data used to generate the model.
Range of the response variable within the data used to generate the model.
Residual standard error of the model.
Mean standard error of the model.
Adjusted R^2 of the model.
Sample size (no. of trees used to fit model).
ss_modelfit()
to fit a specified model for one species.
ss_modelselect()
to select a best-fit model for one species.
ss_modelselect_multi()
to select best-fit models across multiple species.
Other single-species model functions:
ss_modelfit()
,
ss_modelselect_multi()
,
ss_modelselect()
,
ss_predict()
,
ss_simulate()
# first select best-fit model for all species in data data(urbantrees) selected <- ss_modelselect_multi(urbantrees, species = 'species', response = 'height', predictor = 'diameter') # use function results <- ss_modelfit_multi( urbantrees, # any data with similar species (re-use same data in this case) ref_table = selected$ss_models_info, species = 'species', modelcode = 'modelcode', response = 'height', predictor = 'diameter' ) results$ss_models[[1]] # model object for first species in list results$ss_models_info # summary of fitted models
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.