Graph of unconditional associations {MXM} | R Documentation |
Graph of unconditional associations
Description
Calcualtes the graph of unconditional associations. If the correlation (Pearson, Spearman) or the G^2
test of independence, between pairs of continuous or categorical variables respectively is not statistically significant, there is no edge between the two respective nodes.
Usage
corgraph(dataset, test = "testIndFisher", threshold = 0.01)
Arguments
dataset |
A matrix with the variables. The user must know if they are continuous or if they are categorical. If you have a matrix with categorical data, i.e. 0, 1, 2, 3 where each number indicates a category, the minimum number for each variable must be 0. |
test |
The conditional independence test to use. Default value is "testIndFisher". This procedure allows for "testIndFisher", "testIndSPearman" for continuous variables and "gSquare" for categorical variables. |
threshold |
Threshold ( suitable values in (0, 1) ) for assessing p-values significance. Default value is 0.05. |
Value
A list including:
runtime |
The run time of the algorithm. A numeric vector. The first element is the user time, the second element is the system time and the third element is the elapsed time. |
stat |
A matrix with the test statistics. |
pvalue |
A matrix with the p-values. |
G |
The adjancency matrix. A value of 1 in G[i, j] appears in G[j, i] also, indicating that i and j have an edge between them. |
Author(s)
Michail Tsagris
R implementation and documentation: Giorgos Athineou <athineou@csd.uoc.gr> and Michail Tsagris mtsagris@uoc.gr
See Also
pc.skel, mmhc.skel, corfs.network, bn.skel.utils
Examples
# simulate a dataset with continuous data
y <- rdag2(500, p = 20, nei = 3)
x <- y$x
a <- mmhc.skel(x, max_k = 5, threshold = 0.01, test = "testIndFisher" )
b <- pc.skel( x, alpha = 0.01 )
d <- corgraph(x, test = "testIndFisher", threshold = 0.01)