Skip to content

Permutation testing on Brain_Data ("randomise")#286

Merged
ljchang merged 13 commits intocosanlab:masterfrom
ejolly:master
Jun 11, 2019
Merged

Permutation testing on Brain_Data ("randomise")#286
ljchang merged 13 commits intocosanlab:masterfrom
ejolly:master

Conversation

@ejolly
Copy link
Copy Markdown
Collaborator

@ejolly ejolly commented May 31, 2019

Added a stats function and method for permutation testing. Works in the and 2 samples cases. Currently not parallelized because we'd have to share memory in joblib and not sure if that's super efficient/best way to do that. 1 sample sign-flip t-test with ~30 subjects takes about 1 minute without parallelization.

Copy link
Copy Markdown
Member

@ljchang ljchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!, Might be nice to also add an option for thresholding like we do in .ttest(). 'thr_t'. FDR is easy. I have a separate branch I've been working on with TFCE

nltools/stats.py Outdated

for i in range(n_permute):
_, _t = regress(func(X.values), Y, stats='tstats', **kwargs)
p += np.abs(_t) >= np.abs(t)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean this method can only do one-sided permutation tests?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just changed this so we can do both 1 and 2 tailed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added thresholding

ejolly added 3 commits June 1, 2019 14:31
…er than resolution of current Brain_Data object. Also fixed bug where iplot would fail to render background image.
@ejolly
Copy link
Copy Markdown
Collaborator Author

ejolly commented Jun 1, 2019

Added some fixes to plotting. Sometimes if the image resolution was different than the MNI_Template preferences setting, the template prefences would override resulting in the wrong background image being visualized (e.g. 3mm data on 2mm anatomical). Also fixed the bug in iplot that would fail to render the anatomical sometimes.

@ljchang
Copy link
Copy Markdown
Member

ljchang commented Jun 10, 2019

@ejolly: is this ready to be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants