6 Summarizing the model results

The table.statMap function can be used to visualize the statistical results for each topological feature. The default is to present results for cluster extent inference using the first cft that was provided by the user. The table is sorted largest to smallest by the topological features, in this case, the size of the cluster. The two final columns are the unadjusted and adjusted p-values for each cluster. Recall that these results are for the test of whether there is an age by sex interaction. It looks like the first cluster adjusted p-value is “significant” by conventional standards. We can use the write and visualization methods to export the results or make figures for publications.

6.1 Cluster tables

permTable = table.statMap(permStatMap)
robustTable = table.statMap(robustStatMap)
# This creates a table using the larger cluster forming threshold specified above.
stringentTable = table.statMap(robustStatMap, cft_p=cft[2])

knitr::kable(permTable[1:5,], row.names = FALSE,
             digits=3, booktabs=T, caption = "Cluster summary table for permutation test results of the age by sex interaction.")
Table 6.1: Cluster summary table for permutation test results of the age by sex interaction.
Cluster ID Cluster Extent Centroid (vox) Max RESI
1 375 44, 88, 28 0.223
2 183 29, 33, 24 0.203
3 142 52, 39, 10 0.187
4 140 36, 27, 12 0.154
5 134 40, 58, 42 0.188
knitr::kable(robustTable[1:5,], row.names = FALSE,
             digits=3, booktabs=T, caption = "Cluster summary table for wild bootstrap test results of the age by sex interaction.")
Table 6.1: Cluster summary table for wild bootstrap test results of the age by sex interaction.
Cluster ID Cluster Extent Centroid (vox) Max RESI
1 375 44, 88, 28 0.223
2 183 29, 33, 24 0.203
3 142 52, 39, 10 0.187
4 140 36, 27, 12 0.154
5 134 40, 58, 42 0.188

6.2 Writing output and interactive visualization

pbjOutdir = tempdir()
result = write.statMap(robustStatMap, pbjOutdir)
# visualizes template with statistical map and adjusted p-values overlayed
papaya(c(templatefile, result$stat, result$CEI1[1]))
#papaya(c(templatefile, result$stat, result$CMI1[1]))

6.3 Creating figures

#image(robustStatMap, plane = 'axial', cft=cft[1], alpha=0.06, roi=1)

rang = range(robustStatMap$stat)
layoutMat = cbind(matrix(1:6, nrow=2, byrow=TRUE) %x% matrix(1, nrow=3, ncol=3) , 7)
layout(layoutMat)
image(robustStatMap, plane = 'axial', cft_p=cft[1], alpha=0.06, slice=26:31, clusterID = FALSE)
#mtext('Probability', side=3, outer = TRUE, cex=1*cex, font=2)
# these margins adjust the height and width of the color bar bottom,left,top,right
fgcol='white'
par(mar=c(8,4,8,0.5), mgp=c(3,0.6,0), fg=fgcol, col.axis=fgcol, col.lab=fgcol, col.main = fgcol, col.sub=fgcol)
colorBar(pbj:::redyellow(64), min=cft[1], max=rang[2], nticks=4, ylab = 'Chi-sq')