dsep.test: dsep.test

dsep.testR Documentation

dsep.test

Description

This function impliments the dsep test described in Shipley(2000), given a DAG and a covariance matrix of the variables in the DAG. It is identical to the shipley.test function in the ggm library, except that, as a default, it only outputs the null probability of the data given the DAG. This function is meant to be called within other functions. You should use the shipley.test2 function if you want to get complete output.

Usage

dsep.test(amat, S, n, only.null = F)

Arguments

amat

a binary matrix holding the directed acyclic graph; usually produced via the DAG function in the ggm library

S

the covariance matrix of the variables in the DAG

n

the number of independent multivariate observations involved in the covariance matrix

only.null

a logical argument. If TRUE, only the null probability of the data given the DAG is output; otherwise the output mimics the shipley2.test function

Value

the null probability

Author(s)

Bill Shipley

References

Shipley, B. (2000). A new inferential test for path models based on directed acyclic graphs. Structural Equation Modeling, 7(2), 206–218. DOI: 10.1207/S15328007SEM0702_4

Examples

library(ggm)
set.seed(123)
dat <- gen.data()
g <- DAG(B ~ A, C ~ B, D ~ B, E ~ C + D)
dsep.test(amat = g, S = cov(dat), n = 100, only.null = TRUE)
dsep.test(amat = g, S = cov(dat), n=100, only.null = FALSE)

BillShipley/CauseAndCorrelation documentation built on Jan. 31, 2023, 4:20 a.m.