Skip to content

Commit a3643c0

Browse files
author
acp29
committed
Update bootnhst.m
1 parent 71773f4 commit a3643c0

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

inst/bootnhst.m

+6-24
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
% p = bootnhst(DATA,GROUP,ref,bootfun,nboot)
88
% p = bootnhst(DATA,GROUP,ref,bootfun,nboot)
99
% p = bootnhst(DATA,GROUP,ref,bootfun,nboot,paropt)
10-
% p = bootnhst(DATA,GROUP,ref,bootfun,nboot,paropt,bootsam)
1110
% [p,c] = bootnhst(DATA,GROUP,...)
1211
% [p,c,stats] = bootnhst(DATA,GROUP,...)
13-
% [p,c,stats,bootsam] = bootnhst(DATA,GROUP,...)
1412
% bootnhst(DATA,GROUP,...);
1513
%
1614
% This non-parametric bootstrap function can be used for null hypothesis
@@ -88,10 +86,6 @@
8886
% workers should be predefined beforehand by starting
8987
% a parallel pool, else it will use the preferred number
9088
% of workers.
91-
%
92-
% p = bootnhst(DATA,GROUP,ref,bootfun,nboot,paropt,bootsam) performs
93-
% bootstrap computations using the DATA row indices from bootsam for
94-
% the bootstrap (without the need for further resampling).
9589
%
9690
% [p, c] = bootnhst(DATA,GROUP,...) also returns a 9 column matrix that
9791
% summarises post hoc test results. The family-wise error rate is
@@ -149,11 +143,6 @@
149143
% nboot - number of bootstrap resamples
150144
% bootstat - test statistic computed for each bootstrap resample
151145
%
152-
% [p,c,stats,bootsam] = bootnhst(DATA,GROUP,...) also returns bootsam,
153-
% a matrix of indices from the bootstrap. Each column in bootsam
154-
% corresponds to one bootstrap sample and contains the row indices of
155-
% the values drawn from the nonscalar data to create that sample.
156-
%
157146
% bootnhst(DATA,GROUP,...); performs the calculations as per above but
158147
% prints the columns 1, 2 and 5-7 of the results (c) in a pretty table.
159148
% The differences between groups are also plot along with the symmetic
@@ -183,7 +172,7 @@
183172
% along with this program. If not, see <http://www.gnu.org/licenses/>.
184173

185174

186-
function [p, c, stats, bootsam] = bootnhst (data, group, ref, bootfun, nboot, paropt, bootsam)
175+
function [p, c, stats] = bootnhst (data, group, ref, bootfun, nboot, paropt)
187176

188177
% Check and process bootnhst input arguments
189178
nvar = size(data,2);
@@ -263,14 +252,11 @@
263252
end
264253
paropt.nproc = nproc;
265254
end
266-
if nargin < 7
267-
bootsam = [];
255+
if nargout > 6
256+
error('bootnhst only supports up to 6 input arguments')
268257
end
269-
if nargout > 7
270-
error('bootnhst only supports up to 7 input arguments')
271-
end
272-
if nargout > 4
273-
error('bootnhst only supports up to 4 output arguments')
258+
if nargout > 3
259+
error('bootnhst only supports up to 3 output arguments')
274260
end
275261

276262
% Group exclusion using NaN or Inf (excluded group becomes the last group in gnames and gk)
@@ -309,11 +295,7 @@
309295
% Perform resampling and calculate bootstrap statistics
310296
state = warning;
311297
warning off; % silence warnings about non-vectorized bootfun
312-
if nargout > 3
313-
[Q, bootsam] = bootstrp (nboot,func,data,'Options',paropt,'bootsam',bootsam);
314-
else
315-
Q = bootstrp (nboot,func,data,'Options',paropt,'bootsam',bootsam);
316-
end
298+
Q = bootstrp (nboot,func,data,'Options',paropt);
317299
warning(state);
318300

319301
% Calculate pooled (weighted mean) sampling variance using Tukey's jackknife

0 commit comments

Comments
 (0)