Home > matlabmk > rm_ttest.m

rm_ttest

PURPOSE ^

rm_ttest() - Removes sets of t-test results from a GND or GRP variable

SYNOPSIS ^

function GNDorGRP=rm_ttest(GNDorGRP,ttest_ids)

DESCRIPTION ^

 rm_ttest() - Removes sets of t-test results from a GND or GRP variable
             
 Usage:
  >> GNDorGRP=rm_ttest(GNDorGRP,ttest_ids);

 Required Inputs:
   GNDorGRP - A GND or GRP struct variable. GND variables are 
              produced by the functions avgs2GND.m or sets2GND.m.  GRP 
              variables are produced by GNDs2GRP.m.  
   ttest_ids- [integer vector] The index or indices of the set of t-test
              results you would like to remove from the GND or GRP variable.

 Output:
   GNDorGRP - The GND or GRP struct variable with the specified set of 
              t-tests removed.

 Example:
   To remove t-Test Set #2 from a GND variable:
 >> GND=rm_ttest(GND,2);

   To remove t-Test Sets #2-4 and #9-11 from a GND variable:
 >> GND=rm_ttest(GND,[2:4 9:11]);

   To remove t-Test Set #1 from a GRP variable
 >> GRP=rm_ttest(GRP,1);

 Author:
 David Groppe
 Kutaslab, 4/2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % rm_ttest() - Removes sets of t-test results from a GND or GRP variable
0002 %
0003 % Usage:
0004 %  >> GNDorGRP=rm_ttest(GNDorGRP,ttest_ids);
0005 %
0006 % Required Inputs:
0007 %   GNDorGRP - A GND or GRP struct variable. GND variables are
0008 %              produced by the functions avgs2GND.m or sets2GND.m.  GRP
0009 %              variables are produced by GNDs2GRP.m.
0010 %   ttest_ids- [integer vector] The index or indices of the set of t-test
0011 %              results you would like to remove from the GND or GRP variable.
0012 %
0013 % Output:
0014 %   GNDorGRP - The GND or GRP struct variable with the specified set of
0015 %              t-tests removed.
0016 %
0017 % Example:
0018 %   To remove t-Test Set #2 from a GND variable:
0019 % >> GND=rm_ttest(GND,2);
0020 %
0021 %   To remove t-Test Sets #2-4 and #9-11 from a GND variable:
0022 % >> GND=rm_ttest(GND,[2:4 9:11]);
0023 %
0024 %   To remove t-Test Set #1 from a GRP variable
0025 % >> GRP=rm_ttest(GRP,1);
0026 %
0027 % Author:
0028 % David Groppe
0029 % Kutaslab, 4/2010
0030 
0031 function GNDorGRP=rm_ttest(GNDorGRP,ttest_ids)
0032 
0033 n_ttests=length(GNDorGRP.t_tests);
0034 not_have=setdiff(ttest_ids,1:n_ttests);
0035 if ~isempty(not_have),
0036     watchit(['This GND or GRP variable does NOT have the following permutation test(s): ' int2str(not_have)]);
0037 end
0038 ttest_ids=intersect(ttest_ids,1:n_ttests);
0039 if isempty(ttest_ids),
0040     fprintf('Not removing any permutation tests.\n');
0041 else
0042     fprintf('Removing the following permutation test(s): %s\n',int2str(ttest_ids));
0043     use_ptests=setdiff(1:n_ttests,ttest_ids);
0044     GNDorGRP.t_tests=GNDorGRP.t_tests(use_ptests);
0045 end

Generated on Tue 10-May-2016 16:37:45 by m2html © 2005