mix_predict | R Documentation |
Make predictions across rows in a dataset that may contain multiple species. The mixed-effects model is used to predict values for the response variable, as well as it's prediction interval. Necessary bias-corrections are made if the mixed-effects model has a transformed response variable.
mix_predict( data, modelselect, level = 0.95, stat = "median", n.sims = 1000, predictor = "diameter", species = "species", ... )
data |
Dataframe with columns containing the species and variables of interest. Each row is a measurement for an individual tree. |
modelselect |
Output from the |
level |
Level of confidence for the prediction interval. Defaults to
|
stat |
Specify whether the |
n.sims |
Number of bootstrapped simulations to generate the prediction intervals. Defaults to |
predictor |
Column name of the predictor variable in |
species |
Column name of the species variable in |
... |
Additional arguments passed to |
Dataframe of input data
with columns appended:
Predicted value for the response variable.
Lower bound of the prediction interval, based on the input argument level
.
Upper bound of the prediction interval, based on the input argument level
.
merTools::predictInterval()
to make predictions from models fit with the lme4
package.
Other mixed-effects model functions:
mix_modelselect()
,
mix_simulate()
data(urbantrees) ## Not run: model <- mix_modelselect(urbantrees) Alb_sam <- urbantrees[urbantrees$species == 'Albizia saman', ] # use one species as an example results <- mix_predict(data = Alb_sam, modelselect = model, predictor = "diameter") # make predictions for measured values head(results) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.