Learn R Programming

⚠️There's a newer version (2.7-12) of this package.Take me there.

pcalg (version 2.7-10)

Methods for Graphical Models and Causal Inference

Description

Functions for causal structure learning and causal inference using graphical models. The main algorithms for causal structure learning are PC (for observational data without hidden variables), FCI and RFCI (for observational data with hidden variables), and GIES (for a mix of data from observational studies (i.e. observational data) and data from experiments involving interventions (i.e. interventional data) without hidden variables). For causal inference the IDA algorithm, the Generalized Backdoor Criterion (GBC), the Generalized Adjustment Criterion (GAC) and some related functions are implemented. Functions for incorporating background knowledge are provided.

Copy Link

Version

Install

install.packages('pcalg')

Monthly Downloads

1,575

Version

2.7-10

License

GPL (>= 2)

Maintainer

Markus Kalisch

Last Published

February 6th, 2024

Functions in pcalg (2.7-10)

adjustment

Compute adjustment sets for covariate adjustment.
condIndFisherZ

Test Conditional Independence of Gaussians via Fisher's Z
binCItest

G square Test for (Conditional) Independence of Binary Variables
compareGraphs

Compare two graphs in terms of TPR, FPR and TDR
checkTriple

Check Consistency of Conditional Independence for a Triple of Nodes
amatType

Types and Display of Adjacency Matrices in Package 'pcalg'
backdoor

Find Set Satisfying the Generalized Backdoor Criterion (GBC)
corGraph

Computing the correlation graph
beta.special

Compute set of intervention effects
dag2cpdag

Convert a DAG to a CPDAG
beta.special.pcObj

Compute set of intervention effects in a fast way
disCItest

G square Test for (Conditional) Independence of Discrete Variables
dsepTest

Test for d-separation in a DAG
dreach

Compute D-SEP(x,y,G)
fciAlgo-class

Class "fciAlgo" of FCI Algorithm Results
dsepAMTest

Test for d-separation in a MAG
dsepAM

Test for d-separation in a MAG
dsep

Test for d-separation in a DAG
dag2essgraph

Convert a DAG to an Essential Graph
dag2pag

Convert a DAG with latent variables into a PAG
fci

Estimate a PAG with the FCI Algorithm
gAlgo-class

Class "gAlgo"
find.unsh.triple

Find all Unshielded Triples in an Undirected Graph
fciPlus

Estimate a PAG with the FCI+ Algorithm
gac

Test If Set Satisfies Generalized Adjustment Criterion (GAC)
getNextSet

Iteration through a list of all combinations of choose(n,k)
getGraph

Get the "graph" Part or Aspect of R Object
gmB

Graphical Model 5-Dim Binary Example Data
gies

Estimate Interventional Markov Equivalence Class of a DAG by GIES
ges

Estimate the Markov equivalence class of a DAG using GES
gds

Greedy DAG Search to Estimate Markov Equivalence Class of DAG
idaFast

Multiset of Possible Total Causal Effects for Several Target Var.s
iplotPC

Plotting a pcAlgo object using the package igraph
isValidGraph

Check for a DAG, CPDAG or a maximally oriented PDAG
gmInt

Graphical Model 8-Dimensional Interventional Gaussian Example Data
gmI

Graphical Model 7-dim IDA Data Examples
gmL

Latent Variable 4-Dim Graphical Model Data Example
jointIda

Estimate Multiset of Possible Total Joint Effects
gmG

Graphical Model 8-Dimensional Gaussian Example Data
gmD

Graphical Model Discrete 5-Dim Example Data
ida

Estimate Multiset of Possible Joint Total Causal Effects
legal.path

Check if a 3-node-path is Legal
pag2conf

Reads off identifiable unconfounded node pairs from a directed PAG
mat2targets

Conversion between an intervention matrix and a list of intervention targets
opt.target

Get an optimal intervention target
pag2edge

Reads off identifiable parents and non-parents from a directed PAG
optAdjSet

Compute the optimal adjustment set
pag2anc

Reads off identifiable ancestors and non-ancestors from a directed PAG
pcalg2dagitty

Transform the adjacency matrix from pcalg into a dagitty object
mcor

Compute (Large) Correlation Matrix
pc

Estimate the Equivalence Class of a DAG using the PC Algorithm
pc.cons.intern

Utility for conservative and majority rule in PC and FCI
pag2mag

Transform a PAG into a MAG in the Corresponding Markov Equivalence Class
qreach

Compute Possible-D-SEP(x,G) of a node x in a PDAG G
pcAlgo-class

Class "pcAlgo" of PC Algorithm Results, incl. Skeleton
pcorOrder

Compute Partial Correlations
pdsep

Estimate Final Skeleton in the FCI algorithm
pcSelect.presel

Estimate Subgraph around a Response Variable using Preselection
pcalg-internal

Internal Pcalg Functions
plotSG

Plot the subgraph around a Specific Node in a Graph Object
r.gauss.pardag

Generate a Gaussian Causal Model Randomly
randDAG

Random DAG Generation
plotAG

Plot partial ancestral graphs (PAG)
possAn

Find possible ancestors of given node(s).
pdag2dag

Extend a Partially Directed Acyclic Graph (PDAG) to a DAG
pdag2allDags

Enumerate All DAGs in a Markov Equivalence Class
pcAlgo

PC-Algorithm [OLD]: Estimate Skeleton or Equivalence Class of a DAG
pcSelect

PC-Select: Estimate subgraph around a response variable
shd

Compute Structural Hamming Distance (SHD)
randomDAG

Generate a Directed Acyclic Graph (DAG) randomly
rmvnorm.ivent

Simulate from a Gaussian Causal Model
searchAM

Search for certain nodes in a DAG/CPDAG/MAG/PAG
skeleton

Estimate (Initial) Skeleton of a DAG using the PC / PC-Stable Algorithm
wgtMatrix

Weight Matrix of a Graph, e.g., a simulated DAG
possibleDe

[DEPRECATED] Find possible descendants on definite status paths.
trueCov

Covariance matrix of a DAG.
possDe

Find possible descendants of given node(s).
udag2pdag

Last PC Algorithm Step: Extend Object with Skeleton to Completed PDAG
showEdgeList

Show Edge List of pcAlgo object
showAmat

Show Adjacency Matrix of pcAlgo object
rfci

Estimate an RFCI-PAG using the RFCI Algorithm
rmvDAG

Generate Multivariate Data according to a DAG
visibleEdge

Check visible edge.
udag2apag

Last step of RFCI algorithm: Transform partially oriented graph into RFCI-PAG
udag2pag

Last steps of FCI algorithm: Transform Final Skeleton into FCI-PAG
simy

Estimate Interventional Markov Equivalence Class of a DAG
ParDAG-class

Class "ParDAG" of Parametric Causal Models
GaussL0penObsScore-class

Class "GaussL0penObsScore"
LINGAM

Linear non-Gaussian Acyclic Models (LiNGAM)
ages

Estimate an APDAG within the Markov equivalence class of a DAG using AGES
GaussParDAG-class

Class "GaussParDAG" of Gaussian Causal Models
Score-class

Virtual Class "Score"
addBgKnowledge

Add background knowledge to a CPDAG or PDAG
EssGraph-class

Class "EssGraph"
GaussL0penIntScore-class

Class "GaussL0penIntScore"