View source: R/mixed-methods.R
| predict.beezdemand_nlme | R Documentation |
Generates point predictions from a fitted beezdemand_nlme model.
Predictions can be made at the population level (fixed effects only) or
group/subject level (fixed + random effects). The output scale depends
on the equation_form used during model fitting and whether inv_fun is applied.
## S3 method for class 'beezdemand_nlme'
predict(
object,
newdata = NULL,
type = c("response", "link", "population", "individual"),
level = 0,
inv_fun = identity,
se.fit = FALSE,
interval = c("none", "confidence"),
interval_level = 0.95,
...
)
object |
A |
newdata |
Optional data frame for which to make predictions.
Must contain |
type |
One of |
level |
Integer, prediction level for
Default is |
inv_fun |
Optional function to inverse-transform the predictions.
Example: If |
se.fit |
Logical; if |
interval |
One of |
interval_level |
Confidence level when |
... |
Additional arguments passed to |
A tibble containing the original newdata columns plus .fitted.
When requested, .se.fit and .lower/.upper are included (currently NA).
predict.nlme
data(ko)
fit <- fit_demand_mixed(ko, y_var = "y_ll4", x_var = "x",
id_var = "monkey", equation_form = "zben")
# Population-level predictions
preds <- predict(fit, level = 0)
# Subject-level predictions
preds_subj <- predict(fit, level = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.