Description Usage Arguments Details Value Examples
This function performs CMF on a set of potential mediators, given an input and an output variable. It selects those mediators that are deemed relevant by a default or a user-defined decision function, *conditional* on the other mediators in the model. By doing this cyclically, and with multiple random starts, the algorithm outputs an estimate of the best mediators.
1 2 3 |
x |
exogenous variable; numeric vector or data frame with x, y, and at least one M column |
M |
potential mediators; data frame with column names |
y |
outcome variable; numeric vector |
decisionFunction |
either a function with as inputs x, m, y, parameters, and as output a TRUE (include) or FALSE (exclude) statement or a string indicating the built-in decision function to use (see details) |
nStarts |
how many times to start the algorithm |
nCores |
how many threads (cores) to use for parallel processing |
cutoff |
a cutoff value for selection: variables are selected if they
display a selection rate higher than this value. Only relevant when multiple
starts are specified. Can also be specified post-hoc using
|
maxIter |
the maximum number of iterations for each start |
stableLag |
how long does the selection need to be stable before deciding the algorithm has converged |
pb |
Whether to display a progress bar (default TRUE). Only available with built-in decision functions |
... |
parameters passed to decisionFunction |
Available decision functions. These functions are implemented in
C++ to speed up computation. Between brackets the additional parameter that
may be passed to the function in the ...
argument of this function.
(arguments
= defaultvalue
):
- prodcoef
(p.value
= 0.1): Test for the product of
coefficients, Sobel test
- causalsteps
(p.value
= 0.1): Causal steps test min(Ta, Tb)
an object of class cmf
. See cmf-methods
1 2 3 4 | # generate some data
dat <- generateMed(a = (1:10)/20, b = (1:10)/20)
# Run CMF on this data
cmf(dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.