predict.jglmm | R Documentation |
Predictions from a model
## S3 method for class 'jglmm' predict(object, newdata = NULL, type = "link", allow.new.levels = FALSE, ...)
object |
An object of class 'jglmm', as returned by 'jglmm'. |
newdata |
(optional) A dataframe of new data. |
type |
(optional) A character string - either |
allow.new.levels |
(optional) A logical indicating whether new random
effects levels in |
... |
Optional additional arguments, currently none are used. |
A numeric vector of predicted values
## Not run: jglmm_setup() cbpp <- dplyr::mutate(lme4::cbpp, prop = incidence / size) gm1 <- jglmm(prop ~ period + (1 | herd), data = cbpp, family = "binomial", weights = cbpp$size) predict(gm1) predict(gm1, type = "response") newdata <- with(cbpp, expand.grid(period=unique(period), herd=unique(herd))) predict(gm1, newdata) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.