Learn R Programming

gjam (version 2.6.2)

gjamPlot: Plot gjam analysis

Description

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

Usage

gjamPlot(output, plotPars)

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.

Arguments

output

object of class "gjam"

plotPars

list having default values described in Details

Author

James S Clark, jimclark@duke.edu

Details

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

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

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

Run this code
if (FALSE) {
## 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)
}

Run the code above in your browser using DataLab