[Mne_analysis] Grand mean across subjects

Mikołaj Magnuski mmagnuski at swps.edu.pl
Thu Aug 25 05:05:54 EDT 2016
Search archives:

np.stack was added in numpy version 1.10.0 - your numpy is most likely
older (you can check what you get from np.__version__).
But you can use np.dstack instead of np.stack(..., axis=2) - it will work
on older numpy versions.
So, try:

sem_data = sem(np.dstack([x.data for x in evokeds]), axis=2)

​

2016-08-25 10:44 GMT+02:00 Emanuela Liaci <emanuela.liaci at gmail.com>:

> Hi,
>
> thanks for your response. So I tried what you suggested me, by creating a
> list of evokeds (here printed the list for one condition and just 2
> subjects: [<Evoked  |  comment : 'Unknown', kind : average, time :
> [-0.060000, 0.798000], n_epochs : 48, n_channels x n_times : 32 x 430, ~177
> kB>, <Evoked  |  comment : 'Unknown', kind : average, time : [-0.060000,
> 0.798000], n_epochs : 50, n_channels x n_times : 32 x 430, ~177 kB>]).
>
> When I do: sem_data = sem(np.stack([x.data for x in evokeds], axis=2),
> axis=2), I get this error: AttributeError: 'module' object has no attribute
> 'stack'
>
> What does this mean?
>
> Thanks again,
> Emanuela
>
>
>
> On Thu, Aug 25, 2016 at 9:16 AM, Mikołaj Magnuski <mmagnuski at swps.edu.pl>
> wrote:
>
>> Let’s say you have a list of evokeds - evokeds. To get SEM you can do
>> the following:
>>
>> import numpy as npfrom scipy.stats import sem
>>
>> sem_data = sem(np.stack([x.data for x in evokeds], axis=2), axis=2)
>>
>> Now sem_data is an array of size (n_channels, n_samples). To get the
>> lower bound of the SEM you would have to subtract sem_data form the data
>> of your grand average and add it to get the upper bound.
>>>>
>> 2016-08-24 12:23 GMT+02:00 Emanuela Liaci <emanuela.liaci at gmail.com>:
>>
>>> Thanks for the response. A question remains: how can I get the standard
>>> error of the mean?
>>>
>>> Greetings
>>> Emanuela
>>>
>>> On Wed, Aug 17, 2016 at 9:25 PM, Alexandre Gramfort <
>>> alexandre.gramfort at telecom-paristech.fr> wrote:
>>>
>>>> hi,
>>>>
>>>> http://martinos.org/mne/dev/generated/mne.grand_average.html
>>>>
>>>> HTH
>>>> Alex
>>>>
>>>> On Tue, Aug 16, 2016 at 11:41 AM, Emanuela Liaci
>>>> <emanuela.liaci at gmail.com> wrote:
>>>> > Hi,
>>>> >
>>>> > I would like to calculate the grand mean and the standard error across
>>>> > subjects for each of my conditions. Is there a specific function in
>>>> mne to
>>>> > do it starting from each subject's EvokedArray ?
>>>> >
>>>> > Many thanks
>>>> > Emanuela
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > 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.
>>>> >
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>
>>>
>>> _______________________________________________
>>> 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.
>>>
>>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> 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.
>>
>>
>
> _______________________________________________
> 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/20160825/60f83216/attachment.html 


More information about the Mne_analysis mailing list