cmfStep | R Documentation |
One step the cmf function (internal)
cmfStep(x, M, y, decisionFunction, msel, medsamp, ...)
x |
a numeric vector, standardised exogenous variable |
M |
a data frame with column names, potential mediators |
y |
a numeric vector, outcome variable |
decisionFunction |
a function with as inputs x, m, y, parameters, and as output a TRUE (include) or FALSE (exclude) statement |
msel |
binary vector of mediator selections at step i |
medsamp |
which variables to consider |
... |
parameters passed to decisionFunction |
binary vector of mediator selections at step i+1
# generate some data
dat <- generateMed(a = (1:10)/20, b = (1:10)/20)
cmfilter:::cmfStep(dat$x, dat[,-c(1, 12)], dat$y,
decisionFunction = cmfilter:::prodCoef,
msel = c(1, 1, 1, 0, 0, 0, 0, 0, 0, 0),
medsamp = 1:10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.