vglmer-class {vglmer}R Documentation

Generic Functions after Running vglmer

Description

vglmer uses many standard methods from lm and lme4 with limited changes. These provide summaries of the estimated variational distributions.

Usage

## S3 method for class 'vglmer'
fixef(object, ...)

## S3 method for class 'vglmer'
sigma(object, ...)

## S3 method for class 'vglmer'
ranef(object, ...)

## S3 method for class 'vglmer'
coef(object, ...)

## S3 method for class 'vglmer'
vcov(object, ...)

## S3 method for class 'vglmer'
fitted(object, ...)

## S3 method for class 'vglmer'
print(x, ...)

## S3 method for class 'vglmer'
summary(object, display_re = TRUE, ...)

## S3 method for class 'vglmer'
formula(x, form = "original", ...)

format_vglmer(object)

format_glmer(object)

ELBO(object, type = c("final", "trajectory"))

Arguments

object

Model fit using vglmer.

...

Not used; included to maintain compatibility with existing methods.

x

Model fit using vglmer.

display_re

Default (TRUE) prints a summary of the random effects alongside the fixed effects.

form

Describes the type of formula to report: "original" returns the user input, "fe" returns the fixed effects only, "re" returns the random effects only.

type

Default ("final") gives the ELBO at convergence. "trajectory" gives the ELBO estimated at each iteration. This is used to assess model convergence.

Details

The accompanying functions are briefly described below.

coef and vcov return the mean and variance of the fixed effects (\beta). fixef returns the mean of the fixed effects.

ranef extracts the random effects (\alpha) in a similar, although slightly different format, to lme4. It includes the estimated posterior mean and variance in a list of data.frames with one entry per random effect j.

fitted extracts the estimated expected linear predictor, i.e. E_{q(\theta)}[x_i^T \beta + z_i^T \alpha] at convergence.

summary reports the estimates for all fixed effects as in lm as well as some summaries of the random effects (if display_re=TRUE).

format_vglmer collects the mean and variance of the fixed and random effects into a single data.frame. This is useful for examining all of the posterior estimates simultaneously. format_glmer converts an object estimated with [g]lmer into a comparable format.

ELBO extracts the ELBO from the estimated model. type can be set equal to "trajectory" to get the estimated ELBO at each iteration and assess convergence.

sigma extracts the square root of the posterior mode of q(\sigma^2) if a linear model is used.

formula extracts the formula associated with the vglmer object. By default, it returns the formula provided. The fixed and random effects portions can be extracted separately using the form argument.

Value

The functions here return a variety of different objects depending on the specific function. "Details" describes the behavior of each one. Their output is similar to the typical behavior for the corresponding generic functions.


[Package vglmer version 1.0.3 Index]