The rstanarm model-fitting functions return an object of class 'stanreg', which is a list containing at a minimum the components listed below. Each stanreg object will also have additional classes (e.g. 'aov', 'betareg', 'glm', 'polr', etc.) and several additional components depending on the model and estimation algorithm.

Some additional details apply to models estimated using the stan_mvmer or stan_jm modelling functions. The stan_mvmer modelling function returns an object of class 'stanmvreg', which inherits the 'stanreg' class, but has a number of additional elements described in the subsection below. The stan_jm modelling function returns an object of class 'stanjm', which inherits both the 'stanmvreg' and 'stanreg' classes, but has a number of additional elements described in the subsection below. Both the 'stanjm' and 'stanmvreg' classes have several of their own methods for situations in which the default 'stanreg' methods are not suitable; see the See Also section below.


The stan_biglm function is an exception. It returns a stanfit object rather than a stanreg object.

Elements for stanreg objects


Point estimates, as described in print.stanreg.


Standard errors based on mad, as described in print.stanreg.


Residuals of type 'response'.


Fitted mean values. For GLMs the linear predictors are transformed by the inverse link function.


Linear fit on the link scale. For linear models this is the same as fitted.values.


Variance-covariance matrix for the coefficients based on draws from the posterior distribution, the variational approximation, or the asymptotic sampling distribution, depending on the estimation algorithm.


If requested, the the model frame, model matrix and response variable used, respectively.


The family object used.


The matched call.


The model formula.


The data, offset, and weights arguments.


The estimation method used.

A list with information about the prior distributions used.


The object of stanfit-class returned by RStan and a matrix of various summary statistics from the stanfit object.


The version of the rstan package that was used to fit the model.

Elements for stanmvreg objects

The stanmvreg objects contain the majority of the elements described above for stanreg objects, but in most cases these will be a list with each elements of the list correponding to one of the submodels (for example, the family element of a stanmvreg object will be a list with each element of the list containing the family object for one submodel). In addition, stanmvreg objects contain the following additional elements:

The names of the grouping factors and group specific parameters, collapsed across the longitudinal or glmer submodels.


The unique factor levels for each grouping factor, collapsed across the longitudinal or glmer submodels.


The number of longitudinal or glmer submodels.


The number of observations for each longitudinal or glmer submodel.


The number of levels for each grouping factor (for models estimated using stan_jm, this will be equal to n_subjects if the individual is the only grouping factor).


The time taken to fit the model (in minutes).

Additional elements for stanjm objects

The stanjm objects contain the elements described above for stanmvreg objects, but also contain the following additional elements:

The names of the variables distinguishing between individuals, and representing time in the longitudinal submodel.


The number of individuals.


The number of non-censored events.


The event (or censoring) time and status indicator for each individual.


A list containing information about the baseline hazard.


An array containing information about the association structure.


The width of the one-sided difference used to numerically evaluate the slope of the longitudinal trajectory; only relevant if a slope-based association structure was specified (e.g. etaslope, muslope, etc).


The number of Gauss-Kronrod quadrature nodes used to evaluate the cumulative hazard in the joint likelihood function.

See also