Skip to content

Commit

Permalink
added zdist, light wrapper around corr
Browse files Browse the repository at this point in the history
  • Loading branch information
czarrar committed Oct 5, 2012
1 parent 372dd5a commit d496f00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions simulations/lib_utils.R
@@ -0,0 +1,6 @@
zdist <- function(mat, method="cor") {
switch(method,
cor = 1 - corr(mat)
stop("Unsupported method for zdist")
)
}
7 changes: 5 additions & 2 deletions simulations/main.R
Expand Up @@ -95,16 +95,19 @@ subjects_with_diffs <- laply(effect_sizes, function(es) {

}, .progress="text", .parallel=run_parallel)


###
# Distance Matrices
###

distances_with_diffs <- llply(distances_with_diffs, function(Dss) {

llply(Dss, function(Ds) {
aaply())
aaply(Ds) {
as.vector(zdist(t(xs[,,ni])))
})
})

aaply(, 3, function())
as.vector(1 - corr(t(xs[,,ni])))

})

0 comments on commit d496f00

Please sign in to comment.