summary_p.val | R Documentation |
Collect p-values for summary graph.
summary_p.val(lin.anc)
lin.anc |
output from AncReg() |
A numeric matrix of p-values for the summary graph
AncReg
# random DAGS for simulation
set.seed(1234)
p <- 5 #number of nodes
DAG <- pcalg::randomDAG(p, prob = 0.5)
B <- matrix(0, p, p) # represent DAG as matrix
for (i in 2:p){
for(j in 1:(i-1)){
# store edge weights
B[i,j] <- max(0, DAG@edgeData@data[[paste(j,"|",i, sep="")]]$weight)
}
}
colnames(B) <- rownames(B) <- LETTERS[1:p]
# solution in terms of noise
Bprime <- MASS::ginv(diag(p) - B)
n <- 500
N <- matrix(rexp(n * p), ncol = p)
X <- t(Bprime %*% t(N))
colnames(X) <- LETTERS[1:p]
# fit ancestor regression
fit <- AncReg(X)
# collect summary p-values
summary_p.val(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.