Skip to content

Instantly share code, notes, and snippets.

@johncolby
Created April 20, 2011 15:58
Show Gist options
  • Save johncolby/931745 to your computer and use it in GitHub Desktop.
Save johncolby/931745 to your computer and use it in GitHub Desktop.
Modified to always do perms on all tracts/hemispheres
diff --git a/example/between_group/between_grp.R b/example/between_group/between_grp.R
index ffeeaeb..e2d1c08 100644
--- a/example/between_group/between_grp.R
+++ b/example/between_group/between_grp.R
@@ -77,16 +77,7 @@ doPerms <- function(df, demog, nPerms=100){
maxT
}
-# Only correct for multiple comparisons across the tracts with a significant
-# Point:Group interaction F-test. Set the corrected p-values of other tracts to 1
-Ftests = subset(models$anova, Term=='Point:Group')
-sigFtests = which(Ftests$p.value<0.05)
-sigF.Tract = Ftests$Tract[sigFtests]
-sigF.Hemisphere = Ftests$Hemisphere[sigFtests]
-sigF.trk_data = subset(trk_data, Tract==sigF.Tract &
- Hemisphere==sigF.Hemisphere)
-
-maxT = doPerms(sigF.trk_data, demog, nPerms)
+maxT = doPerms(trk_data, demog, nPerms)
# Execute in a terminal to utilize multiple cores and do lots of perms!
#library(multicore)
@@ -113,7 +104,6 @@ getP <- function(testT, maxT){
maxT.no.na = maxT[is.na(maxT)==F]
crit = floor((1-thresh)*length(maxT.no.na))
models$tTable$p.val.adj = sapply(models$tTable$t, getP, maxT.no.na)
-models$tTable$p.val.adj[-as.numeric(row.names(subset(models$tTable, Tract==sigF.Tract & Hemisphere==sigF.Hemispher
# Add a Position column for easier plotting
models$tTable = ddply(models$tTable, c("Tract", "Hemisphere"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment