[Swift-commit] r2138 - SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/permutations/scripts
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Fri Jul 18 13:18:20 CDT 2008
Author: skenny
Date: 2008-07-18 13:18:20 -0500 (Fri, 18 Jul 2008)
New Revision: 2138
Added:
SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/permutations/scripts/oldpermFriedman.R
Log:
perm stuff
Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/permutations/scripts/oldpermFriedman.R
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/permutations/scripts/oldpermFriedman.R (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/permutations/scripts/oldpermFriedman.R 2008-07-18 18:18:20 UTC (rev 2138)
@@ -0,0 +1,31 @@
+#---- this is to do friedman non-parametric permutation tests
+allinputs <- Sys.getenv("R_SWIFT_ARGS")
+print(Sys.getenv("R_SWIFT_ARGS"));
+brain <- noquote(strsplit(allinputs," ")[[1]][1])
+perm_start <- as.integer(noquote(strsplit(allinputs," ")[[1]][2]))
+print(brain)
+print(perm_start)
+print(date())
+outname <- paste("outputs/",brain,"_batchstart",perm_start,"output.txt",sep="");
+print(outname)
+
+m <- matrix(nrow=7000,ncol=2);
+perm_end <- perm_start + (nrow(m)-1);
+mat_row <- 0;
+for (vert in perm_start:perm_end){
+ perm_mat <- matrix(nrow=24,ncol=3)
+ perm_mat_col = 1
+ for (col in 1:ncol(perm_mat)){
+ for (i in 1:nrow(perm_mat)){
+ perm_mat[i,col] <- sample(c(-2:2),1)
+ }
+ }
+ mat_row = mat_row + 1
+ friedman_test <- friedman.test(perm_mat)
+ vert_id <- as.integer(vert)
+ m[mat_row, ] <- c(vert_id, friedman_test$statistic[[1]])
+ rm(perm_mat)
+}
+m <- round(m,5)
+print(date())
+write.table(m, file=outname, row.names=FALSE, col.names=FALSE, quote=F)
More information about the Swift-commit
mailing list