mcmcPlots: generate plots of model(s) posterior results

Description Usage Arguments Value Note Author(s) See Also

View source: R/mcmcPlots.R

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

1
2
3
4
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 = number of random effect parameters, per subject.

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 a single set of multiple membership effects.

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 effects.

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.subj.aff.

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 terms.

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.U

by group plot of session effects, u[1:Nsession]. Plot is faceted for more than one set of effect terms.

p.Umm

plot of "mm = W.subj.aff %*% u" for those clients attending assessions.

p.Ub0

plot of " mm + b0", the total random intercept, for those clients attending sessions.

p.Ub

plot of "mm + b" for multivariate MM effects with order equal to "Nrandom".

p.b

stacked plots of b0,...,b(q-1) - vertical lines for each client span 2.5% - 97.5% values with mean noted.

p.M

MCMC trace plot of M, number of clusters.

p.tauu

MCMC trace plots of tau.u. Plot is faceted for more than one set of effect terms.

p.taue

MCMC trace plots of tau.e.

p.taub

MCMC faceted trace plot for each of the q components of tau.b.

p.dev

MCMC trace plots of deviance.

Note

Intended as an internal function for dpgrow, dpgrowmm, and dpgrowmult

Author(s)

Terrance Savitsky tds151@gmail.com

See Also

dpgrowmm, dpgrow


growcurves documentation built on May 2, 2019, 7:03 a.m.