Description Usage Arguments Value Examples
View source: R/sinhelpfunctions.R
This function converts a matrix of simultaneous p-values into a graph by comparing the p-values to a user-provided significance level.
1 |
pvals |
a matrix of simultaneous p-values. |
alpha |
a significance level, i.e., alpha in (0,1). |
type |
a string specifying the type of graph that should be
obtained from the p-value matrix. If type equals |
blocks |
a list of integer vectors specifying a family of subsets of the variables. |
The function returns an adjacency matrix A with A[i,j]=0 if there is no edge between vertices (variables) i and j. The convention for edges is that i-j if and only if A[i,j]=A[j,i]=1, i->j if and only if A[i,j]=1 and A[j,i]=0, and i<->j if and only if A[i,j]=A[j,i]=2.
1 2 3 4 5 6 7 8 9 10 11 12 | data(fowlbones)
pvals <- sinUG(fowlbones$corr,fowlbones$n)
alpha <- 0.2
## get undirected graph
getgraph(pvals, alpha, type="UG")
## forget that we used sinUG and get acyclic directed graph
getgraph(pvals, alpha, type="DAG")
## forget that we used sinUG and get bidirected graph
getgraph(pvals, alpha, type="BG")
## forget that we used sinUG and get chain graph
myblocks <- list(1:2,3:4,5:6)
getgraph(pvals, alpha, type="CG", blocks=myblocks)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.