predictions | R Documentation |
The functions compute_predictions
and compare_predictions
compute predictions and compare
them, respectively. In both cases, 95% confidence intervals are computed, and it is
possible to account for the random effects by integrating predictions over the entire
distribution of such effects. In such a case, the predictions produced thus correspond to
marginal predictions.
compare_predictions(
fit,
newdata,
oddsratio = FALSE,
random = TRUE,
nb_boot = 1000L,
seed = 123L
)
compute_predictions(fit, newdata, random = TRUE, nb_boot = 1000L, seed = 123L)
fit |
a model fitted (directly or indirectly) with |
newdata |
a |
oddsratio |
a |
random |
a |
nb_boot |
the number of simulations for the parametric bootstrap used to compute the intervals |
seed |
an |
We recommend you to look at the raw R code of these functions on GitHub (file '/R/predictions_and_CI.R') to understand how they work. We commented the code to make this clear. While you could directly look at the code of these functions while using the package, mind that the comments will have been stripped away during the installation process. We kept all the code of each function self contained, instead of writing modular functions to ease the exploration of the code (everything is in one place). One drawback is that it leads to a code full of repetitions.
a list containing the predictions (or differences in predictions) and
intervals, as well as the estimates from each bootstrap replicate used to compute
the intervals and the object created by boot.ci
.
compare_predictions()
: compute differences or odds ratio between two predictions
compute_predictions()
: compute multiple predictions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.