as_draws: Creates a 'draws' object

View source: R/draws.R

as_drawsR Documentation

Creates a draws object

Description

Creates a draws object which is the final output of a call to draws().

Usage

as_draws(method, samples, data, formula, n_failures = NULL, fit = NULL)

Arguments

method

A method object as generated by either method_bayes(), method_approxbayes(), method_condmean() or method_bmlmi().

samples

A list of sample_single objects. See sample_single().

data

R6 longdata object containing all relevant input data information.

formula

Fixed effects formula object used for the model specification.

n_failures

Absolute number of failures of the model fit.

fit

If method_bayes() is chosen, returns the MCMC Stan fit object. Otherwise NULL.

Value

A draws object which is a named list containing the following:

  • data: R6 longdata object containing all relevant input data information.

  • method: A method object as generated by either method_bayes(), method_approxbayes() or method_condmean().

  • samples: list containing the estimated parameters of interest. Each element of samples is a named list containing the following:

    • ids: vector of characters containing the ids of the subjects included in the original dataset.

    • beta: numeric vector of estimated regression coefficients.

    • sigma: list of estimated covariance matrices (one for each level of vars$group).

    • theta: numeric vector of transformed covariances.

    • failed: Logical. TRUE if the model fit failed.

    • ids_samp: vector of characters containing the ids of the subjects included in the given sample.

  • fit: if method_bayes() is chosen, returns the MCMC Stan fit object. Otherwise NULL.

  • n_failures: absolute number of failures of the model fit. Relevant only for method_condmean(type = "bootstrap"), method_approxbayes() and method_bmlmi().

  • formula: fixed effects formula object used for the model specification.


rbmi documentation built on Nov. 24, 2023, 5:11 p.m.