gjamIIEplot: Plots indirect effects and interactions for gjam data

View source: R/gjamIIEplot.r

gjamIIEplotR Documentation

Plots indirect effects and interactions for gjam data

Description

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

Usage

  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

## Not run: 
f   <- gjamSimData(S = 10, Q = 6, typeNames = 'OC')
ml  <- list(ng = 50, burnin = 5, typeNames = f$typeNames)
out <- gjam(f$formula, f$xdata, f$ydata, modelList = ml)

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

fit <- gjamIIE(out, xvector)

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

## End(Not run)

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