Learn R Programming

ddgraph (version 1.16.0)

independent.contributions.formula.mul: Generate class labels by independent contributions of two variables

Description

Version of independent.contributions.formula that works with any number of variables. See the help page for independent.contributions.formula for description of functionality.

Usage

independent.contributions.formula.mul(data, target.vars, prob1, prob0, logical.formula)

Arguments

data
a matrix or data.frame containing binary observations (columns are variables)
target.vars
indexes of target variables
prob1
vector of P(class labels = 1|varX=1) for different X
prob0
vector of P(class labels = 1|varX=0) for different X
logical.formula
a character string for the formula

Value

Examples

Run this code
data <- cbind("a"=c(0,0,0,0,1,1,1,1), "b"=c(0,0,1,1,0,0,1,1), "c"=c(0,1,0,1,0,1,0,1))
independent.contributions.formula.mul(data, c("a", "b", "c"), c(0.9, 0.9, 0.8), c(0.1, 0.1, 0.2), "a | b | c")

Run the code above in your browser using DataLab