Learn R Programming

growcurves (version 0.2.3.8)

ddpMCMCplots: generate plots of posterior samples under ddpgrow model

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

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
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
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 pa
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.thetastacked plots of b0,...,b(q-1) - vertical lines for each client span 2.5noted.
  • p.MMCMC trace plot of M, number of clusters.
  • p.acarMCMC trace plots of alphacar, the CAR strength parameter. Plot is faceted for more than one set of treatments under "car".
  • p.tcarMCMC trace plots of alphacar, the CAR precision parameter. Plot is faceted for more than one set of treatments under "car".
  • p.taueMCMC trace plots of tau.e.
  • p.devMCMC trace plots of deviance.
  • p.lamHeatmap (tiled) plot of posterior mean covariance, Lambda, of polynomial orders of random effects, Delta_i.
  • p.mvnHeatmap plots of posterior mean covariance, Pmvn, of treatment dosages under "mvn" base distribution. Plots are faceted by treatment.
  • p.aband95% credible bands for alphacar CAR strength parameters associated to treatments under "car" base distribution.
  • p.tband95% credible bands for taucar CAR precision parameters associated to treatments under "car" base distribution.
  • p.iband95% credible bands for tauind dose precision parameters for "ind" base distribution, faceted by treatment (if more than one).

See Also

ddpgrow, dpgrowmm, dpgrow, dpgrowmult