Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/brainGraph_mediate.R
brainGraph_mediate
performs simple mediation analyses in which a given
graph or vertexlevel measure (e.g., weighted global efficiency)
is the mediator M. The outcome (or dependent/response) variable
Y can be a neuropsychological measure (e.g., IQ) or
can be a diseasespecific metric (e.g., recovery time). The treatment
variable should be a factor
.
1 2 3 4 
g.list 
A list of 
covars 
A data table containing covariates of interest. It must include
columns for Study.ID, the treatment variable, 
mediator 
Character string; the name of the graph measure acting as the mediating variable 
treat 
Character string; the treatment variable (e.g., Group) 
outcome 
Character string; the name of the outcome variable of interest (e.g., fullscale IQ, memory, etc.) 
covar.names 
Character vector of the column names in 
level 
Character string; either 
boot 
Logical indicating whether or not to perform bootstrapping
(default: 
boot.ci.type 
Character string; which type of CI's to calculate
(default: 
N 
Integer; the number of bootstrap samples to run (default:

conf.level 
Numeric; the level of the CI's to calculate (default:

control.value 
Value of 
treat.value 
Value of 
long 
Logical indicating whether or not to return all bootstrap samples
(default: 
int 
Logical indicating whether or not to include an interaction of the
mediator and treatment (default: 
... 
Other arguments passed to 
This code was adapted closely from mediate
in the
mediation
package, and the procedure is exactly the same as theirs
(see the references listed below). So, if you use this function, please cite
their work.
As of brainGraph v2.0.0
, this function has been tested only for a
treatment (independent) variable X being a 2level factor (e.g.,
disease group, old vs. young, etc.).
Allowing for treatmentmediator interaction (setting int=TRUE
)
currently will only work properly if the mediator is a continuous variable;
since the mediator is always a graph metric, this should always be the case.
An object of class bg_mediate
with elements:
level 
Either 
removed 
A character vector of Study.ID's removed due to incomplete data 
X.m, X.y 
Design matrices for the model with the mediator as the
outcome variable ( 
y.m, y.y 
Outomce variables for the associated design matrices above.

res.obs 
A 
res.ci 
A 
res.p 
A 
boot 
Logical, the 
boot.ci.type 
Character string indicating which type of bootstrap confidence intervals were calculated. 
res.boot 
A 
treat 
Character string of the treatment variable. 
mediator 
Character string of the mediator variable. 
outcome 
Character string of the outcome variable. 
covariates 
Returns 
INT 
Logical indicating whether the models included an interaction between treatment and mediator. 
conf.level 
The confidence level. 
control.value 
The value of the treatment variable used as the control condition. 
treat.value 
The value of the treatment variable used as the treatment condition. 
nobs 
Integer; the number of observations in the models. 
sims 
Integer; the number of bootstrap replications. 
covar.names 
The pretreatment covariate names. 
Christopher G. Watson, [email protected]
Tingley D, Yamamoto T, Hirose K, Keele L, Imai K (2014). mediation: R package for causal mediation analysis. Journal of Statistical Software, 59(5):138.
Imai K, Keele L, Yamamoto T (2010). Identification, inference, and sensitivity analysis for causal mediation effects. Statistical Science, 25(1):5171.
Imai K, Keele L, Tingley D (2010). A general approach to causal mediation analysis. Psychological Methods, 15(4):309334.
Imai K, Keele L, Tingley D, Yamamoto T (2011). Unpacking the black box of causality: learning about causal mechanisms from experimental and observational studies. American Political Science Review, 105(4):765789.
Imai K, Yamamoto T (2013). Identification and sensitivity analysis for multiple causal mechanisms: revisiting evidence from framing experiments. Political Analysis, 21(2):141171.
Other Group analysis functions: IndividualContributions
,
NBS
, brainGraph_GLM
,
brainGraph_boot
,
brainGraph_permute
, mtpc
1 2 3 4 5 6 7 8 9 10  ## Not run:
med.EglobWt.FSIQ < brainGraph_mediate(dt.G[threshold == thresholds[5]],
covars.med, 'E.global.wt', 'Group', 'FSIQ', covar.names=c('age', 'gender'),
boot=TRUE, N=1e4)
med.strength.FSIQ <
brainGraph_mediate(dt.V[threshold == thresholds[5] & region == 'lcACC'],
covars.med, 'strength', 'Group', 'FSIQ',
covar.names=c('age', 'gender'), N=1e3)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.