Automatise T-tests with DPABI

Submitted by David on

Hi,

I'm trying to run several  (two sample) t-tests in a row (a few hundred) where I randomly select from a total sample of say 100 people many smaller samples and calculate t-tests by using the function y_TTest2_Image. This works fine so far when I have different folders where the data for every sample (and group) lies, because the function needs two directories (2 by 1 cell) as input. That's not practical when using hundreds of samples, so instead I want it to accept a series of filenames I selected directly e.g. from  a 2 by n cell variable (2 groups, n subject nifti files)  I created by randomly sampling.  I found out that the ReadAll function accepts a cell of filenames, but I don't know how to adapt the code so that the  y_TTest2_Image function accepts it. 

What would be the best way to do that? 

Many thanks in advance :)

YAN Chao-Gan

Fri, 11/06/2015 - 03:26

Hi David,

y_TTest2_Image needs 2 by 1 cell. (help y_TTest2_Image)

For each cell, it could be (help y_ReadAll):

%                  1. A single file (.img/hdr, .nii, or .nii.gz), give the path and filename.
%                  2. A directory, under which could be a single 4D file, or a set of 3D images

 

%                  3. A Cell (nFile * 1 cells) of filenames of 3D image file, or a single file of 4D NIfTI file.

 

 

Best,

Chao-Gan