ranef-ubmsFit-method: Extract Random Effects

ranef,ubmsFit-methodR Documentation

Extract Random Effects

Description

Extract random effects from a ubmsFit model. Note that this function works like ranef for merMod objects from lme4, not like ranef for unmarkedFit objects. To get functionality similar to that of unmarkedFit, use posterior_predict.

Usage

## S4 method for signature 'ubmsFit'
ranef(object, submodel, summary = FALSE, add_mean = TRUE, ...)

Arguments

object

A fitted model of class ubmsFit

submodel

The name of the submodel, as a character string, for which to generate the random effects

summary

If TRUE, calculate mean, SD, and 95 for each random effect term

add_mean

If TRUE (the default) add the overall intercept or slope mean and return the complete random intercept or slope.

...

Currently ignored

Details

Note: by default this function adds the overall intercept or slope to the (mean-0) random effect to get the complete random intercept or slope. In this way the output is more like the output of lme4::coef and not lme4::ranef. You can turn this off and return just the mean-0 random effect by setting argument add_mean = FALSE.

If you run ranef on a submodel with a spatial random effect, the function will return estimates of parameter eta.

Value

If summary=FALSE, a list of random effect values; if TRUE, a data frame with columns for random effect mean, SD, and 95

See Also

ranef, posterior_predict


kenkellner/ubms documentation built on March 1, 2025, 7:02 a.m.