Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.array.stan_nma

Convert samples into arrays, matrices, or data frames


Description

Samples (post warm-up) from a stan_nma model object can be coerced into an array, matrix, or data frame.

Usage

## S3 method for class 'stan_nma'
as.array(x, ..., pars, include = TRUE)

## S3 method for class 'stan_nma'
as.data.frame(x, ..., pars, include = TRUE)

## S3 method for class 'stan_nma'
as.matrix(x, ..., pars, include = TRUE)

Arguments

x

A stan_nma object

...

Additional arguments passed to as.array.stanfit()

pars

Optional character vector of parameter names to include in output. If not specified, all parameters are used.

include

Logical, are parameters in pars to be included (TRUE, default) or excluded (FALSE)?

Value

The as.array() method produces a 3D array [Iteration, Chain, Parameter] containing posterior samples of each parameter (as class mcmc_array). This has the side effect of enabling bayesplot functions to seamlessly work on stan_nma objects.

The as.data.frame() method produces a data frame containing posterior samples of each parameter, combined over all chains.

The as.matrix() method produces a matrix containing posterior samples of each parameter, combined over all chains.


multinma

Bayesian Network Meta-Analysis of Individual and Aggregate Data

v0.3.0
GPL-3
Authors
David M. Phillippo [aut, cre] (<https://orcid.org/0000-0003-2672-7841>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.