help > Warning: Divide by zero.
Showing 1-5 of 5 posts
Display:
Results per page:
Aug 20, 2015  03:08 PM | Chunliang Feng
Warning: Divide by zero.
Hi Donald,

    I've been using gPPI toolbox, and everything goes well except the following warning message:

Warning: Divide by zero.
> In createVec at 757
In spm_contrasts_PPI at 126
In PPPI at 796
In g_PPI at 37
Valid Contrast


What may cause this warning message? The contrast images are created despite the warning message.

Best,
Chunliang
Aug 21, 2015  02:08 PM | Donald McLaren
Warning: Divide by zero.
Chunliang,

What is the code in your version of createVec.m at 757?
Is it:
try
trialminimum=trialcountminper;
catch
trialminimum=trialcountmin./sum(tce>0); %Only count
event-related effects
end


Is this a block design or an event-related design?

If you are using a block design, this shouldn't be an issue.
Aug 21, 2015  02:08 PM | Chunliang Feng
RE: Warning: Divide by zero.
Hi Donald,

     Thanks for your reply. Yes, createVec.m at 757 included the code that you pasted.

     It is an event-related design; however, duration of each event in the GLM was set to a non-zero value (i.e., boxcar regressor), and response time was added as a parametric regressor for each trial. The followings are part of scripts to set up tasks and contrasts.

P.Tasks={'0','condA_run1','condB_run1','condA_run2','condB_run2'};


P.Contrasts(1).left={'condA_run1' 'condA_run2'};
P.Contrasts(1).right={'none'};
P.Contrasts(1).STAT='T';
P.Contrasts(1).Weighted=0;
P.Contrasts(1).MinEvents=1;
P.Contrasts(1).name='condA';



Best,
Chunliang
Aug 21, 2015  03:08 PM | Donald McLaren
RE: Warning: Divide by zero.
Because you specified Weighted as 0, and your events are non-zero duration,
then the program treats the data as a block design. This just means that
when it averages across runs, each run gets an equal weighting - rather
than weighting based on the number of trials.

I will fix this piece of code to avoid the warning message in the future.

Also, RT as a PM doesn't make much sense because RT should change the
duration of the neural activity rather than just changing the amplitude.

In the future, you don't need to specify the run # in the condition name as
each run # is prepended to the task name in the GLM.
Aug 22, 2015  02:08 AM | Chunliang Feng
RE: Warning: Divide by zero.
I see. Thanks again~~~

Best,
 Chunliang