[Mne_analysis] Repeated-measured oneway ANOVA / paired ttest in spatio temporal clustering
Eric Larson
larson.eric.d at gmail.com
Mon Oct 27 10:19:31 EDT 2014
Maybe I don't fully understand the question, but I believe you want to use
spatial_temporal_cluster_1samp_test. The paired t-test between two
conditions should be the same as a one-sample t-test on the difference
between those conditions. You can see it by looking at the one-sample
t-test and paired t-test equations:
http://en.wikipedia.org/wiki/Student%27s_t-test#Dependent_t-test_for_paired_samples
You can also check out the docs of `ttest_1samp` and `ttest_rel` in
`scipy.stats`, and see them in action:
>>> from scipy.stats import ttest_1samp, ttest_rel
>>> x = np.random.rand(10)
>>> y = np.random.rand(10) + 1
>>> ttest_1samp(x - y, 0)
(-8.4152236461504959, 1.4741495462601121e-05)
>>> ttest_rel(x, y)
(-8.4152236461504959, 1.4741495462601121e-05)
We thus operate on the difference signal for efficiency in mne-python,
which should work for your use case.
Eric
On Mon, Oct 27, 2014 at 7:03 AM, Laetitia Grabot <laetitia.grabot at gmail.com>
wrote:
> Dear mailing list,
>
> I'm doing spatio-temporal clustering on 12 subjects in source space. Very
> basically, I would like to compare two conditions by taking into account
> subjects variability, so I need to do a paired ttest/oneway
> repeated-measure ANOVA. Yet, the spatio_temporal_cluster_test function is
> only implementing oneway anova, while the spatio_temporal_cluster_1samp_test
> is implementing simple ttest on the difference
> *.*
> *I looked at related issues on github and found that there is a twoway
> anova with repeated measures function implemented under the name of
> f_twoway_rm but it doesn't work for oneway anova (factor_levels = [2],
> n_conditions = 2). Then I tried to build a stat_fun function from *
>
> *scipy.stats.ttest_rel:*
>
> *def stat_fun(*args):*
>
> * a = X[0]*
> * b = X[1]** return *
> *scipy.stats.ttest_rel(a,b)*
>
> *But I get an error at lign 708 in _permutation_cluster_test (cannot copy
> sequence with size 2 to array axis with dimension 0), I guessed there is a
> format problem in my stat_fun function...*
>
>
> *Did someone find a way to do such an analysis?*
>
>
> *Thanks in advance,Laetitia Grabot.*
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20141027/d800c665/attachment.html
More information about the Mne_analysis
mailing list