cmfStep: One step the cmf function (internal)

Description Usage Arguments Value Examples

View source: R/cmfslow.R

Description

One step the cmf function (internal)

Usage

1
cmfStep(x, M, y, decisionFunction, msel, medsamp, ...)

Arguments

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

Value

binary vector of mediator selections at step i+1

Examples

1
2
3
4
5
6
# 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)

cmfilter documentation built on April 11, 2019, 5:07 p.m.

Related to cmfStep in cmfilter...