From psytao18 at connect.hku.hk Mon Feb 6 06:00:05 2023 From: psytao18 at connect.hku.hk (Xia Tao) Date: Mon, 6 Feb 2023 11:00:05 +0000 Subject: [Mne_analysis] Cluster-based permutation test with correlation Message-ID: External Email - Use Caution Dear MNE users, I am trying to explore the relationship between my behavioral outcome and sigma power at all time points. I attempted to conduct a permutation cluster test using Pearson correlation as my statistic, but I encountered an error: TypeError: No loop matching the specified signature and casting was found for ufunc add. If anyone has encountered this issue and knows how to resolve it, I would greatly appreciate your help. Here is the code and error in detail: def statistic(x, y): return pearsonr(x, y).statistic c_obs, clusters_c, cluster_p_values, H0 = \ permutation_cluster_test([sigma,behavioral],tail=0,threshold=0.05,stat_fun=statistic,n_jobs=-1,n_permutations=1000)#competition vs noncompetition error: [cid:c4c57b94-82d8-45b9-b310-e92df4421778] Thank you, Tao -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20230206/5395ec42/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 182451 bytes Desc: image.png Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20230206/5395ec42/attachment-0001.png From larson.eric.d at gmail.com Mon Feb 6 09:48:39 2023 From: larson.eric.d at gmail.com (Eric Larson) Date: Mon, 6 Feb 2023 09:48:39 -0500 Subject: [Mne_analysis] Cluster-based permutation test with correlation In-Reply-To: References: Message-ID: External Email - Use Caution It's probably worth searching something like "cluster correlations" on MNE's Discourse forum, this is the first result for example (but there are probably other relevant ones): https://secure-web.cisco.com/1Wv3G9Thqu_oLCxyi15yhRqKEe3lE-vDkD1DcSXJFf1N4Ap6HFFqdoWUkiMqUWQZAPe4DJedmfVzM8pXpiJ_E8EY3KSDyCHNKwalczZkkA5m-plWWyaFskBtHtG999stg5omav3WcErdUrrLMjxH3H8nVmFEivD8oSPS6EjQcRVTvreBUcku76sA3uc3yzaajojS6lsI5uix_eY9wyuTcUznyVcr5-ntAtJ2IqUD9Edre0ergOMfelgMaDh6P2WcLo9Vh_8TnBhJSX8NY6MguiM08TXwD1o122Tp9EALU7ZPTVExHvucVNnAEcVatD4xGAf27cXht37pJmtY6lg4bnQ/https%3A%2F%2Fmne.discourse.group%2Ft%2Fcluster-based-correlations-in-mne%2F1508 Eric On Mon, Feb 6, 2023 at 6:00 AM Xia Tao wrote: > External Email - Use Caution > > Dear MNE users, > > I am trying to explore the relationship between my behavioral outcome and > sigma power at all time points. I attempted to conduct a permutation > cluster test using Pearson correlation as my statistic, but I encountered > an error: TypeError: No loop matching the specified signature and casting > was found for ufunc add. > > If anyone has encountered this issue and knows how to resolve it, I would > greatly appreciate your help. > > Here is the code and error in detail: > > def statistic(x, y): > return pearsonr(x, y).statistic > > c_obs, clusters_c, cluster_p_values, H0 = \ > > permutation_cluster_test([sigma,behavioral],tail=0,threshold=0.05,stat_fun=statistic,n_jobs=-1,n_permutations=1000)#competition > vs noncompetition > > error: > Thank you, > Tao > > > > > > > > > > > > > > > _______________________________________________ > Mne_analysis mailing list > Mne_analysis at nmr.mgh.harvard.edu > https://secure-web.cisco.com/1UjXhlGpYe7yfAo_XNJzAzd3DS9wp3WH51M4nZyG1BAoIfFliPiknaQJunAEJzzNgnXBY2PeajGINS-VBUQqu-uXubDiwd5Q-rxCeiMi6tu9z-26U0QB_1o-31y-PooWl9JR71esePo0VOEaO-ntEU0b29mCzH8fDRVxLZMZkVo5fZviIxQYHp1SyVSgW7eR44YX-Blu7RELj4p625CNbYbmg8DmRU0MnRQW7LR0dzVrHDx1aNEKWtWeEVz-aL_JXfmLZB_o5f8VAiJkvhUNiwpdtBEVozFeIO7auIxb5dnnOxTcl1tfadg3fFDXlbI6sNWcipwxnjeFj5QDUB77XQQ/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_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 Mass General > Brigham Compliance HelpLine at > https://secure-web.cisco.com/1oYkB70EVUJVu1qrmwyyre_nYKeE1LJrGqL9sZ7yvlH3ggywPdRjya3V8iyyOKOMwiP5ePFaT9LLZsMxHkz4eCVLpzodqh163KnGSskKOFgpjxL20VNWhASlmlFOjS3ss2otQEShtrLL91b5EbCPtyjfbHqpfuTKI7ylhMNGIZe1M6jrcw0TY3kacy1imSVpWs1Kgnt5mtoZQLPuYchxDdPIm8e1p6ndKm6jLrvjxubueVmEnB7Cv1LqA6YBCxHTe20e3fLZiB4SlsKQM00ZERSYnyqjc-Tpc5PIK0q9m1eUrb6cOYIMJxv0S1BVV_vbbxfyLKFYsdKoL7YsUE3fi7w/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline < > https://secure-web.cisco.com/1oYkB70EVUJVu1qrmwyyre_nYKeE1LJrGqL9sZ7yvlH3ggywPdRjya3V8iyyOKOMwiP5ePFaT9LLZsMxHkz4eCVLpzodqh163KnGSskKOFgpjxL20VNWhASlmlFOjS3ss2otQEShtrLL91b5EbCPtyjfbHqpfuTKI7ylhMNGIZe1M6jrcw0TY3kacy1imSVpWs1Kgnt5mtoZQLPuYchxDdPIm8e1p6ndKm6jLrvjxubueVmEnB7Cv1LqA6YBCxHTe20e3fLZiB4SlsKQM00ZERSYnyqjc-Tpc5PIK0q9m1eUrb6cOYIMJxv0S1BVV_vbbxfyLKFYsdKoL7YsUE3fi7w/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline> . > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20230206/89010b48/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 182451 bytes Desc: not available Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20230206/89010b48/attachment-0001.png