mod2obspred | R Documentation |
This function takes a model object and returns the observed and (optionally) the fitted values in that model.
mod2obspred(model, obs.only = FALSE)
model |
a model object of class "glm", "gam", "gbm", "GBMFit", "randomForest" or "bart" from which the response variable and fitted (predicted) values can be extracted. Note that, for "randomForest" models, only the out-of-bag prediction is available from the model object (see |
obs.only |
logical value indicating whether only 'obs' should be obtained (saves computing time when 'pred' not needed – used e.g. by |
A data frame with one column containing the observed and (if obs.only=FALSE, the default) another column containing the predicted values from 'model'.
A. Marcia Barbosa
prevalence
data(rotif.mods)
mod <- rotif.mods$models[[1]]
obspred <- mod2obspred(mod)
head(obspred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.