pathFinder: Perturbed path search utility

View source: R/semPaths.R

pathFinderR Documentation

Perturbed path search utility

Description

This function uses SEMace to find significant causal effects between source-sink pairs and SEMpath to fit them and test their edge perturbation.

Usage

pathFinder(
  graph,
  data,
  group = NULL,
  ace = NULL,
  path = "directed",
  method = "BH",
  alpha = 0.05,
  ...
)

Arguments

graph

Input network as an igraph object.

data

A matrix or data.frame. Rows correspond to subjects, and columns to graph nodes (variables).

group

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. Group specification enables edge perturbation testing. By default, group = NULL.

ace

A data.frame generated by SEMace. If NULL, SEMace will be automatically run.

path

If path = "directed", all directed paths between the two nodes will be included in the fitted model. If path = "shortest", only shortest paths will be considered.

method

Multiple testing correction method. One of the values available in p.adjust. By default, method = "BH" (i.e., FDR multiple test correction).

alpha

Significance level for ACE selection (by default, alpha = 0.05).

...

Currently ignored.

Value

A list of 3 objects:

  • "paths", list of paths as igraph objects;

  • "fit", fitting results for each path as a lavaan object;

  • "dfp", a data.frame containing SEM global fitting statistics.

Author(s)

Fernando Palluzzi fernando.palluzzi@gmail.com

Examples



# Find and evaluate significantly perturbed paths

# Nonparanormal(npn) transformation
als.npn <- transformData(alsData$exprs)$data

adjData <- SEMbap(alsData$graph, als.npn)$data

paths <- pathFinder(alsData$graph, adjData,
                    group = alsData$group,
                    ace = NULL)

print(paths$dfp)
head(parameterEstimates(paths$fit[[1]]))
gplot(paths$paths[[1]])



SEMgraph documentation built on Sept. 11, 2024, 8:36 p.m.