Learn R Programming

growcurves (version 0.2.3.7)

mcmcPlots: generate plots of model(s) posterior results

Description

Constructs plots of subject and multiple membership effects, as well as traceplots for model precision and clustering parameters. Returns a list of objects of class ggplot.

Usage

mcmcPlots(subjecti.u, subj.aff = NULL, subjaff.input = NULL, bmat.summary,
  group = NULL, groupi.u = NULL, u.summary = NULL, Nmv = 1,
  ulabs = NULL, mm.summary = NULL, M = NULL, Tauu = NULL, Taub, Taue,
  Deviance)

Arguments

subjecti.u
A vector of length P, number of unique subjects, containing unique set of user input values for subject.
subj.aff
A vector of length P.aff identifying the unique subjects (which are a subset of variable, subject) receiving multiple membership random effects. Applies only to case of a single set of multiple membership random effects.
subjaff.input
User input version of subj.aff that may be character or numeric format. (Again, this is a strict subset of subjecti.u). Applies only to case of a single set of multiple membership random effects.
bmat.summary
A list object of q elements, each containing an P x 3 matrix of c(2.5%,50%,97.5%) quantile summaries for each subject of the applicable subject random effect parameter. P = number of subjects, q
group
An S x 1 vector of group identifiers for the multiple membership random effects, where S is the number of multiple membership random effects. The format is sequential numeric, starting at 1. Applies only to case of
groupi.u
A vector of user input unique values for the multiple membership effect group identifiers where employ 1 multiple membership term. Input as a list of S x 1 vectors in the case of more than one set of multiple membership effects.
u.summary
An S x 3 matrix of of quantile summaries for each multiple membership session effect where employ 1 multiple membership term. Input as list of S x 3 quantiles in the case of more than one set of multiple membership e
Nmv
The order for the multiple membership effects. Defaults to Nmv = 1 for univariate effects. Otherwise, Nmv > 1 indicates that u.summary is dimensioned as Nmv*S x 3.
ulabs
An nty vector of labels for each term (block) in the case of more than one set of multiple membership effects.
mm.summary
A P.aff x 3 matrix of quantile summaries. mm was created by multiple the set of S multiple membership effects, u, on each MCMC iteration by the multiple membership design matrix, W.sub
M
The iter.keep x 1 matrix of posterior samples for the parameter capturing the number of clusters formed under the DP prior on the client effects.
Tauu
iter.keep x 1 matrix of posterior samples capturing the precision parameter for "mmcar", "mmi" and "mmigrp". Input as iter.keep x nty matrix in the case of nty multiple membership effect ter
Taub
iter.keep x Nrandom matrix of posterior samples capturing the precision parameter for each of the sets of subject random effects.
Taue
iter.keep x 1 matrix of posterior samples capturing the precision parameter for the model error term.
Deviance
iter.keep x 1 matrix of posterior samples for the model deviance.

Value

  • A list of plot objects of class ggplot2 including:
  • p.Uby group plot of session effects, u[1:Nsession]. Plot is faceted for more than one set of effect terms.
  • p.Ummplot of "mm = W.subj.affclients attending assessions.
  • p.Ub0plot of " mm + b0", the total random intercept, for those clients attending sessions.
  • p.Ubplot of "mm + b" for multivariate MM effects with order equal to "Nrandom".
  • p.bstacked plots of b0,...,b(q-1) - vertical lines for each client span 2.5% - 97.5% values with mean noted.
  • p.MMCMC trace plot of M, number of clusters.
  • p.tauuMCMC trace plots of tau.u. Plot is faceted for more than one set of effect terms.
  • p.taueMCMC trace plots of tau.e.
  • p.taubMCMC faceted trace plot for each of the q components of tau.b.
  • p.devMCMC trace plots of deviance.

See Also

dpgrowmm, dpgrow