Causal.Inference: Causal Inference function

Causal.InferenceR Documentation

Causal Inference function

Description

This function impliments the CI (Causal Inference) Algorithm of Pearl (2009). It takes the multivariate observations (3 or more variables) as input and determines the partly directed dependency graph that corresponds to the patterns of correlation and partial correlation in the input data.

Usage

Causal.Inference(dat, alpha.reject = 0.05, write.result = T)

Arguments

dat

a matrix or data frame containing only numeric variables

alpha.reject

the significance level used in deciding if a d-separation claim exists or not

write.result

a logical argument; if FALSE only the binary output matrix is written. If TRUE, the partially oriented dependency graph is output

Details

As currently written, the funtiton assumes multivariate normality of the input data (so all variables must be numeric) and the statistical inferences are obtained via Pearson (partial) correlation coefficients. Alternatively, if your input data are in the form of ranks (for example, via the ranks() function), then Spearman rank (partial) correlations are used. This function only obtains the output for the given alpha.reject value and is called by the Exploratory.path.analysis function, which is the function that you should normally use.

Value

Either a binary matrix (if write.result=F), or the partially oriented dependency graph (if write.result=T). A "0", "1", or "2" in the binary matrix means "no edge", "undirected edge", or "edge into the column variable", respectively. A – B means an indirected edge between variables A and B A –> B means an edge from A into B.

Author(s)

Bill Shipley

References

Pearl, J. 2009. Causality. Models, Reasoning , and Inference (2nd edition). Cambridge University Press. ISBN: 9780521895606

Shipley, B. 2016. Cause and Correlation in Biology: A user's guide to path analysis, structural equations and causal inference in R. Cambridge University Press. ISBN: 9781107442597

See Also

dsep.test, Pcor.prob, shipley.test2

Examples

set.seed(123)
dat <- gen.data()
Causal.Inference(dat = dat, alpha.reject = 0.05, write = TRUE)

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