ss_simulate | R Documentation |
Wrapper function that runs ss_predict()
on simulated data. Data is simulated
for each species based on the range of the predictor variable used to fit the
model, which can be extrapolated to values defined by the user. The
corresponding model object in models
will be used to make predictions on the
simulated data. The user may choose to run this function on one or multiple
species, using the argument select_sp
.
ss_simulate( ref_table, models, select_sp = NULL, level = 0.95, length.out = 100, extrapolate = NULL, species = "species", predictor_min = "predictor_min", predictor_max = "predictor_max", response_min = "response_min", response_max = "response_max", cf = "correctn_factor", geom_mean = "response_geom_mean" )
ref_table |
Dataframe containing model information. It should include
columns for |
models |
A named list of each species' linear regression models.
|
select_sp |
Character vector of species names, if you want to run this
function only for selected species in |
level |
Level of confidence for the prediction interval. Defaults to
|
length.out |
Number of new predictor values to generate for each species. Defaults to 100. Set a higher value for greater resolution at the cost of computational time. |
extrapolate |
Numeric vector of 2 elements (e.g. |
species |
Column name in |
predictor_min |
Column name in |
predictor_max |
Column name in |
response_min |
Column name in |
response_max |
Column name in |
cf |
Column name in |
geom_mean |
Column name in |
The model associated with each species is used to predict values for the response variable, as well as it's prediction interval. Necessary bias-corrections are made for species with models that have a transformed response variable.
A dataframe with columns:
Name of tree species.
Variable used to make predictions.
Predicted value.
Lower bound of the prediction interval, based on the input argument level
.
Upper bound of the prediction interval, based on the input argument level
.
Indicates whether the predictions are based on extrapolated values. Either 'High', 'Low', or 'No' (not extrapolated).
ss_predict()
to make predictions for all species in a dataset using
single-species linear models.
Other single-species model functions:
ss_modelfit_multi()
,
ss_modelfit()
,
ss_modelselect_multi()
,
ss_modelselect()
,
ss_predict()
# first select best-fit model for all species in data data(urbantrees) results <- ss_modelselect_multi(urbantrees, species = 'species', response = 'height', predictor = 'diameter') ## Not run: # simulate for all species ss_simulate(ref_table = results$ss_models_info, models = results$ss_models) # simulate for selected species ss_simulate(ref_table = results$ss_models_info, models = results$ss_models, selected_spp = 'Albizia saman') # simulate with extrapolated values ss_simulate(ref_table = results$ss_models_info, models = results$ss_models, extrapolate = c(0,3)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.