gjamIIEplot: Plots indirect effects and interactions for gjam data

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/gjamIIEplot.r

Description

Using the object returned by gjamIIEplot generates a plot for a response variable.

Usage

1
2
  gjamIIEplot(fit, response, effectMu, effectSd = NULL, 
              ylim = NULL, col='black', legLoc = 'topleft', cex = 1)

Arguments

fit

object from gjamIIE.

response

name of a column in fit$y to plot.

effectMu

character vector of mean effects to plot, can include 'main','int','direct','ind'.

effectSd

character vector can include all or some of effectMu.

ylim

vector of two values defines vertical axis range.

col

vector of colors for barplot.

legLoc

character for legend location.

cex

font size.

Details

For plotting direct effects, interactions, and indirect effects from an object fit generated by gjamIIE. The character vector supplied as effectMu can include main effects ('main'), interactions ('int'), main effects plus interactions ('direct'), and/or indirect effects ('ind'). The list effectSd draws 0.95 predictive intervals for all or some of the effects listed in effectMu. Bars are contributions of each effect to the response.

For factors, effects are plotted relative to the mean over all factor levels.

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

gjamIIE generates output for gjamIIEplot

A more detailed vignette is can be obtained with:

browseVignettes('gjam')

web site 'http://sites.nicholas.duke.edu/clarklab/code/'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
sim <- gjamSimData(S = 10, Q = 6, typeNames = 'OC')
ml  <- list(ng = 50, burnin = 5, typeNames = sim$typeNames)
out <- gjam(sim$formula, sim$xdata, sim$ydata, modelList = ml)

xvector <- colMeans(out$inputs$x)  #predict at mean values for data
xvector[1] <- 1

fit <- gjamIIE(out, xvector)

gjamIIEplot(fit, response = 'S1', effectMu = c('main','ind'), 
            effectSd = c('main','ind'), legLoc = 'topleft')

## End(Not run)

dbystrova/GJAM_clust documentation built on Sept. 15, 2020, 5:46 p.m.