gjamPlot: Plot gjam analysis

View source: R/gjamPlot.r

gjamPlotR Documentation

Plot gjam analysis

Description

Constructs plots of posterior distributions, predictive distributions, and additional analysis from output of gjam.

Usage

  gjamPlot(output, plotPars)

Arguments

output

object of class "gjam"

plotPars

list having default values described in Details

Details

plotPars a list that can contain the following, listed with default values:

PLOTY = T plot predicted y.
PLOTX = T plot inverse predicted x.
PREDICTX = T inverse prediction of x; does not work if PREDICTX = F in link{gjam}.
ncluster number of clusters to highlight in cluster diagrams, default based on S.
CORLINES = T draw grid lines on grid plots of R and E.
cex = 1 text size for grid plots, see par.
BETAGRID = T draw grid of beta coefficients.
PLOTALLY = F an individual plot for each column in y.
SMALLPLOTS = T avoids plot margin error on some devices, better appearance if FALSE.
GRIDPLOTS = F cluster and grid plots derived from parameters; matrices R and E are discussed in Clark et al. (2016).
SAVEPLOTS = F plots saved in pdf format.
outfolder = 'gjamOutput' folder for plot files if SAVEPLOTS = T.
width, height = 4 can be small values, in inches, to avoid plot margin error on some devices.
specColor = 'black' color for posterior box-and-whisker plots.
ematAlpha = .95 prob threshold used to infer that a covariance value in Emat is not zero.
ncluster = 4 number of clusters to identify in ematrix.

The 'plot margin' errors mentioned above are device-dependent. They can be avoided by specifying small width, height (in inches) and by omitting the grid plots (GRIDPLOTS = F). If plotting does not produce a 'plot margin error', better appearance is obtained with SMALLPLOTS = F.

Names will not be legible for large numbers of species. Specify specLabs = F and use a character vector for specColor to identify species groups (see the gjam vignette on dimension reduction).

Box and whisker plots bound 0.68 and 0.95 credible and predictive intervals.

Value

Summary tables of parameter estimates are:

betaEstimates

Posterior summary of beta coefficients.

clusterIndex

cluster index for responses in grid/cluster plots.

clusterOrder

order for responses in grid/cluster plots.

eComs

groups based on clustering ematrix.

ematrix

S X S response correlation matrix for E.

eValues

eigenvalues of ematrix.

eVecs

eigenvectors of ematrix.

fit

list containing DIC, score, and rmspe.

Author(s)

James S Clark, jimclark@duke.edu

References

Clark, J.S., D. Nemergut, B. Seyednasrollah, P. Turner, and S. Zhang. 2017. Generalized joint attribute modeling for biodiversity analysis: Median-zero, multivariate, multifarious data. Ecological Monographs 87, 34-56.

See Also

gjam A more detailed vignette is can be obtained with:

browseVignettes('gjam')

website 'http://sites.nicholas.duke.edu/clarklab/code/'.

Examples

## Not run: 
## ordinal data
f   <- gjamSimData(S = 15, Q = 3, typeNames = 'OC') 
ml  <- list(ng = 1500, burnin = 500, typeNames = f$typeNames, holdoutN = 10)
out <- gjam(f$formula, f$xdata, f$ydata, modelList = ml)

# repeat with ng = 2000, burnin = 500, then plot data here:
pl  <- list(trueValues = f$trueValues, width=3, height=2)
fit <- gjamPlot(output = out, plotPars = pl)

## End(Not run)

gjam documentation built on May 24, 2022, 1:06 a.m.