Summaries of parameter estimates and MCMC convergence diagnostics (Monte Carlo error, effective sample size, Rhat).

# S3 method for stapreg
summary(object, pars = NULL, regex_pars = NULL,
  probs = NULL, waic = F, include_X = FALSE, ..., digits = 1)

# S3 method for summary.stapreg
print(x, digits = max(1, attr(x,
  "print.digits")), ...)

# S3 method for summary.stapreg
as.data.frame(x, ...)

Arguments

object

A fitted model object returned by one of the rstap modeling functions. See stapreg-objects.

pars

An optional character vector specifying a subset of parameters to display. Parameters can be specified by name or several shortcuts can be used. Using pars="beta" will restrict the displayed parameters to only the regression coefficients (without the intercept). "alpha" can also be used as a shortcut for "(Intercept)". If the model has varying intercepts and/or slopes they can be selected using pars = "varying".

In addition, for stapmvreg objects there are some additional shortcuts available. Using pars = "long" will display the parameter estimates for the longitudinal submodels only (excluding group-specific pparameters, but including auxiliary parameters). Using pars = "event" will display the parameter estimates for the event submodel only, including any association parameters. Using pars = "assoc" will display only the association parameters. Using pars = "fixef" will display all fixed effects, but not the random effects or the auxiliary parameters. pars and regex_pars are set to NULL then all fixed effect regression coefficients are selected, as well as any auxiliary parameters and the log posterior.

If pars is NULL all parameters are selected for a stapreg object.

regex_pars

An optional character vector of regular expressions to use for parameter selection. regex_pars can be used in place of pars or in addition to pars. Currently, all functions that accept a regex_pars argument ignore it for models fit using optimization.

probs

For models fit using MCMC, an optional numeric vector of probabilities passed to quantile.

waic

logical to determine whether waic should be calculated and printed with the summary object

include_X

logical for whether or not estimated latent STAP exposure should be included in summary defaults to FALSE

...

Currently ignored.

digits

Number of digits to use for formatting numbers when printing. When calling summary, the value of digits is stored as the "print.digits" attribute of the returned object.

x

An object of class "summary.stapreg".

Value

The summary method returns an object of class "summary.stapreg", inheriting "summary.stapreg"), which is a matrix of summary statistics and diagnostics, with attributes storing information for use by the print method. The print method for summary.stapreg or summary.stapmvreg objects is called for its side effect and just returns its input. The as.data.frame method for summary.stapreg objects converts the matrix to a data.frame, preserving row and column names but dropping the print-related attributes.

See also

prior_summary to extract or print a summary of the priors used for a particular model.