SEMpath | R Documentation |
Find and fit all directed or shortest paths between two source-sink nodes of a graph.
SEMpath(graph, data, group, from, to, path, verbose = FALSE, ...)
graph |
An igraph object. |
data |
A matrix or data.frame. Rows correspond to subjects, and columns to graph nodes (variables). |
group |
A binary vector. This vector must be as long as the
number of subjects. Each vector element must be 1 for cases and 0
for control subjects. If |
from |
Starting node name (i.e., source node). |
to |
Ending node name (i.e., sink node). |
path |
If |
verbose |
Show the directed (or shortest) path between the given source-sink pair inside the input graph. |
... |
Currently ignored. |
A list of four objects: a fitted model object of class
lavaan
("fit"), aggregated and node-specific
group effect estimates and P-values ("gest"), the extracted subnetwork
as an igraph object ("graph"), and the input graph with a color
attribute mapping the chosen path ("map").
Mario Grassi mario.grassi@unipv.it
# Directed path fitting
path <- SEMpath(graph = sachs$graph, data = log(sachs$pkc),
group = sachs$group,
from = "PIP3",
to = "Erk",
path = "directed")
# Summaries
summary(path$fit)
print(path$gest)
# Graphs
gplot(path$map, main="path from PiP2 to Erk")
plot(path$map, layout=layout.circle, main="path from PiP2 to Erk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.