pymare.results.BayesianMetaRegressionResults

class BayesianMetaRegressionResults(data, dataset, ci=95.0)[source]

Bases: object

Container for MCMC sampling-based PyMARE meta-regression estimators.

Parameters:
  • data (pystan.StanFit4Model or arviz.InferenceData) – Either a StanFit4Model instance returned from PyStan or an ArviZ InferenceData instance.

  • dataset (Dataset) – A Dataset instance containing the inputs to the estimator.

  • ci (float, optional) – Desired width of highest posterior density (HPD) interval. Default = 95.0 (95%).

plot(kind='trace', **kwargs)[source]

Generate various plots of the posterior estimates via ArviZ.

Parameters:
  • kind (str, optional) – The type of ArviZ plot to generate. Can be any named function of the form “plot_{}” in the ArviZ namespace (e.g., ‘trace’, ‘forest’, ‘posterior’, etc.). Default = ‘trace’.

  • **kwargs – Optional keyword arguments passed onto the corresponding ArviZ plotting function (see ArviZ docs for details).

Return type:

A matplotlib or bokeh object, depending on plot kind and kwargs.

summary(include_theta=False, **kwargs)[source]

Summarize the posterior estimates via ArviZ.

Parameters:
  • include_theta (bool, optional) – Whether or not to include the estimated group-level means in the summary. Default = False.

  • **kwargs – Optional keyword arguments to pass onto ArviZ’s summary().

Returns:

A pandas DataFrame, unless the fmt=”xarray” argument is passed in kwargs, in which case an xarray Dataset is returned.

Return type:

pandas.DataFrame