ddpMCMCplots: generate plots of posterior samples under 'ddpgrow' model

Description Usage Arguments Value Note Author(s) See Also

View source: R/ddpMCMCplots.R

Description

Constructs plots for subject effects, theta, with credible intervals as well as selected trace plots. Returns a list of objects of class ggplot.

Usage

1
2
3
4
ddpMCMCplots(subjecti.u, labt = NULL, typet, numt, theta.summary, lambda.mean,
  pmvn.mean = NULL, taucar.summary = NULL, alphacar.summary = NULL,
  Taucar = NULL, Alphacar = NULL, tauind.summary = NULL, Tauind = NULL,
  M, Taue, Deviance)

Arguments

subjecti.u

A vector of length P, number of unique subjects, containing unique set of user input values for subject.

labt

An vector object (of the same length as typet) providing user names for each treatment. The names are used in plot objects.

typet

A numeric vector of length equal to the number of treatments that specifies prior option for each treatment. Options must be one of: 1 = "car", 2 = "mvn", 3 = "ind".

numt

A numeric vector with same length as typet where each entry counts the number of doses for that treatment.

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

lambda.mean

A q x q matrix of mean values of the polyomial order covariance matrix, Lambda, returned from ddpgrow.

pmvn.mean

A list object of length equal to the number of treatments with "mvn" %in% typetreat. Each list object contains an numt[m] x numt[m] matrix of mean elements of the "mvn" treatments covariance matrices, Pmvn, returned from ddpgrow.

taucar.summary

A numcar x 3 numeric matrix of c(2.5%,50%,97.5%) quantile summaries for the scale parameter for numcar treatments where "car" %in% typetreat.

alphacar.summary

A numcar x 3 numeric matrix of c(2.5%,50%,97.5%) quantile summaries for the strength parameter for numcar treatments where "car" %in% typetreat.

Taucar

An iter.keep x numcar matrix of posterior samples capturing the CAR precision parameter for each treatment where "car" %in% typetreat.

Alphacar

An iter.keep x numcar matrix of posterior samples capturing the CAR strength parameter for each treatment where "car" %in% typetreat.

tauind.summary

A list object of length equal to numcar, the number of treatment with "in" %in% typetreat. Each list element contains an numt[m] x 3 matrix of c(2.5%,50%,97.5%) quantile summaries for the dosage scale parameters associated to that treatment m.

Tauind

A list object of length numind, the number treatments where "car" %in% typetreat with each element holding an nkeep x numt[m] matrix of sampled by-dose precision parameters for treatment m.

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.

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

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

MCMC trace plots of alphacar, the CAR strength parameter. Plot is faceted for more than one set of treatments under "car".

p.tcar

MCMC trace plots of alphacar, the CAR precision parameter. Plot is faceted for more than one set of treatments under "car".

p.taue

MCMC trace plots of tau.e.

p.dev

MCMC trace plots of deviance.

p.lam

Heatmap (tiled) plot of posterior mean covariance, Lambda, of polynomial orders of random effects, Delta_i.

p.mvn

Heatmap plots of posterior mean covariance, Pmvn, of treatment dosages under "mvn" base distribution. Plots are faceted by treatment.

p.aband

95% credible bands for alphacar CAR strength parameters associated to treatments under "car" base distribution.

p.tband

95% credible bands for taucar CAR precision parameters associated to treatments under "car" base distribution.

p.iband

95% credible bands for tauind dose precision parameters for "ind" base distribution, faceted by treatment (if more than one).

Note

Intended as an internal function for ddpgrow

Author(s)

Terrance Savitsky tds151@gmail.com

See Also

ddpgrow, dpgrowmm, dpgrow, dpgrowmult


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