search for: chiarray

Displaying 1 result from an estimated 1 matches for "chiarray".

Did you mean: chararray
2013 Jun 24
1
help needed with printing multiple arguments as vectors, not matrices
...as a table and not a matrix as below along with the p-value? Any help will be greatly appreciated fish <- function(y, x) {n00 = sum((1-x)*(1-y)); n01 = sum((1-x)*y); n10 = sum(x*(1-y)); n11 = sum(x*y); a = matrix(c(n00, n01, n10, n11), nrow = 2); pval = fisher.test(a)$p.value; return(pval);} chiArray <- function(x) { apply(mat1, 1, fish, x); } sapply(1:nrow(mat2), function(j){chiArray(mat2[j, ]);}); chisq.cna.mut.test <- sapply(1:nrow(mat2), function(j){chiArray(mat2[j, ]);}); I want output to be: name1_mat1 name1_mat2 n00 n01 n10 n11 pvalue name1_mat1 name2_mat2 n00 n01 n10 n11 p...