graphModel {fairadapt} | R Documentation |
Obtaining the graphical causal model (GCM)
Description
Obtaining the graphical causal model (GCM)
Usage
graphModel(adj.mat, cfd.mat = NULL, res.vars = NULL)
Arguments
adj.mat |
Matrix of class |
cfd.mat |
Symmetric matrix of class |
res.vars |
A vector of class |
Value
An object of class igraph
, containing the causal graphical,
with directed and bidirected edges.
Examples
adj.mat <- cfd.mat <- array(0L, dim = c(3, 3))
colnames(adj.mat) <- rownames(adj.mat) <-
colnames(cfd.mat) <- rownames(cfd.mat) <- c("A", "X", "Y")
adj.mat["A", "X"] <- adj.mat["X", "Y"] <-
cfd.mat["X", "Y"] <- cfd.mat["Y", "X"] <- 1L
gcm <- graphModel(adj.mat, cfd.mat, res.vars = "X")