Back to the main page.

Bug 325 - statfun_depsamplesT units of observation issue

Reported 2010-12-17 23:24:00 +0100
Modified 2011-01-06 09:17:45 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Matt Mollison - 2010-12-17 23:24:50 +0100

I'm using fieldtrip-20101216 on Matlab 2010b on a Mac Pro running OS X 10.6.5. I'm surprised I'm finding this bug because statfun_depsamplesT seems like such a basic function. I hope I'm not doing something wrong, but I don't think I am because I encounter this problem when running ft_timelockstatistics in the event related statistics tutorial: The issue seems to be that the count for units of observation is incorrect in statfun_depsamplesT. Specifically, when there are 2 conditions (cfg.uvar=2), when nunits is calculated on line 60, it counts each subject twice. I believe line 60 in statfun_depsamplesT should be: nunits = length(unique(design(cfg.uvar,:))); When I make this change, the results are the same as when using matlab's ttest (seen in the eventrelatedstatistics tutorial).

Jan-Mathijs Schoffelen - 2010-12-19 14:01:48 +0100

Thanks for reporting this, Matt. I'll look at it asap with high priority. Best wishes, Jan-Mathijs

Jan-Mathijs Schoffelen - 2010-12-19 14:54:37 +0100

Hi Matt, I reproduced the issue. With me it actually leads to a crash... I fixed it (don't know how and when it was introduced however, because it seemed to work just fine). Should be available as of tonight (CET) at out ftp-server. Thanks for reporting it. Could you check whether it works for you and then close the bug? Thanks JM

Matt Mollison - 2010-12-20 21:10:24 +0100

This now works for me with fieldtrip-20101219. I guess this was just a mistake in the script, but it's weird (and scary) that something like this could be changed without noticing the bug... Anyway thanks for implementing the change quickly. Best, Matt