gjamIIE {gjam} | R Documentation |
Indirect effects and interactions for gjam data
Description
Evaluates direct, indirect, and interactions from a gjam
object. Returns a list
of objects that can be plotted by gjamIIEplot
.
Usage
gjamIIE(output, xvector, MEAN = T, keepNames = NULL, omitY = NULL,
sdScaleX = T, sdScaleY = F)
Arguments
output |
object of |
xvector |
vector of predictor values, with names, corresponding to columns in |
MEAN |
|
omitY |
|
keepNames |
|
sdScaleX |
standardize coefficients to X scale. |
sdScaleY |
standardize coefficients to correlation scale. |
Details
For plotting or recovering effects. The list fit$IIE
has matrices for main effects (mainEffect
), interactions (intEffect
), direct effects (dirEffect
), indirect effects (indEffectTo
), and standard deviations for each. The direct effects are the sum of main effects and interactions. The indirect effects include main effects and interactions that come through other species, determined by covariance matrix sigma
.
If sdScaleX = T
effects are standandardized from the Y/X to Y scale. This is the typical standardization for predictor variables. If sdScaleY = T
effects are given on the correlation scale. If both are true effects are dimensionless. See the gjam vignette on dimension reduction.
Value
A list of objects for plotting by gjamIIEplot
.
Author(s)
James S Clark, jimclark@duke.edu
References
Clark, J.S., D. Nemergut, B. Seyednasrollah, P. Turner, and S. Zhang. 2016. Generalized joint attribute modeling for biodiversity analysis: Median-zero, multivariate, multifarious data. Ecological Monographs 87, 34-56.
See Also
gjamIIEplot
plots output from gjamIIE
A more detailed vignette is can be obtained with:
browseVignettes('gjam')
web site 'http://sites.nicholas.duke.edu/clarklab/code/'.
Examples
## Not run:
sim <- gjamSimData(S = 12, Q = 5, typeNames = 'CA')
ml <- list(ng = 50, burnin = 5, typeNames = sim$typeNames)
out <- gjam(sim$formula, sim$xdata, sim$ydata, modelList = ml)
xvector <- colMeans(out$inputs$xStand) #predict at mean values for data
xvector[1] <- 1
fit <- gjamIIE(output = out, xvector)
gjamIIEplot(fit, response = 'S1', effectMu = c('main','ind'),
effectSd = c('main','ind'), legLoc = 'topleft')
## End(Not run)