Skip to content

Commit

Permalink
minor code formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
acp29 committed Jan 18, 2024
1 parent 296e1f8 commit a60e228
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
8 changes: 4 additions & 4 deletions inst/boot1way.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
end
if ((nboot(2) == 0) && (~ strcmp (func2str (bootfun), 'mean')))
if (~ exist ('jackknife','file'))
if (ISOCTAVE);
if (ISOCTAVE)
warning ('boot1way:jackfail', cat (2, '''jackknife'' function from', ...
' statistics package not found. nboot(2) set to 100.'))
else
Expand Down Expand Up @@ -434,15 +434,15 @@
theta(j) = mean (data(g == gk(j), :));
% Quick analytical calculation for the standard error of the mean
SE(j) = std (data(g == gk(j), :), 0) / sqrt (nk(j));
if (j == 1); se_method = 'Calculated without resampling'; end;
if (j == 1); se_method = 'Calculated without resampling'; end
else
theta(j) = bootfun (data(g == gk(j), :));
% If requested, compute unbiased estimates of the standard error using
% jackknife resampling
jackstat = jackknife (bootfun, data(g == gk(j), :));
SE(j) = sqrt ((nk(j) - 1) / nk(j) * ...
sum (((mean (jackstat) - jackstat)).^2));
if (j == 1); se_method = 'Leave-one-out jackknife'; end;
if (j == 1); se_method = 'Leave-one-out jackknife'; end
end
else
% Compute unbiased estimate of the standard error by balanced bootknife
Expand All @@ -453,7 +453,7 @@
bootout = bootknife (data(g == gk(j), :), [nboot(2), 0], bootfun, ...
NaN, [], 0, [], [], ISOCTAVE, false, true);
SE(j) = bootout.std_error;
if (j==1); se_method = 'Balanced, bootknife resampling'; end;
if (j==1); se_method = 'Balanced, bootknife resampling'; end
end
Var(j) = ((nk(j) - 1) / (N - k)) * SE(j)^2;
end
Expand Down
15 changes: 6 additions & 9 deletions inst/bootlm.m
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
case 'seed'
SEED = value;
otherwise
error (sprintf ('bootlm: parameter %s is not supported', name))
error ('bootlm: parameter %s is not supported', name)
end
end

Expand Down Expand Up @@ -681,17 +681,15 @@
% Check whether all the columns sum to 0
if (any (abs (sum (CONTRASTS{i})) > eps ('single')))
contr_sum_to_zero (i) = false;
warning (sprintf ( ...
'Note that the CONTRASTS for predictor %u do not sum to zero', i))
warning ('Note that the CONTRASTS for predictor %u do not sum to zero', i)
else
contr_sum_to_zero (i) = true;
end
% Check whether contrasts are orthogonal
if (any (abs (reshape (cov2corr (cov (CONTRASTS{i})) - ...
eye (size (CONTRASTS{i}, 2)), [], 1)) ...
> eps ('single')))
warning (sprintf ( ...
'Note that the CONTRASTS for predictor %u are not orthogonal', i))
warning ('Note that the CONTRASTS for predictor %u are not orthogonal', i)
end
else
if (~ ismember (lower (CONTRASTS{i}), ...
Expand All @@ -715,8 +713,7 @@
if (~ isempty (DIM))
for i = 1:K
if (~ contr_sum_to_zero (i))
warning (sprintf ( ...
'CONTRASTS for predictor %u have been set to ''anova''', i))
warning ('CONTRASTS for predictor %u have been set to ''anova''', i)
end
end
CONTRASTS(~ contr_sum_to_zero) = {'anova'};
Expand Down Expand Up @@ -1332,7 +1329,7 @@
plot (ax4_xlim, ones (1, 2), 'k--');
hold off;
arrayfun (@(i) text (DI(i), D(DI(i)), ...
sprintf (' %u', DI(i))), [1:min(nk,n)]);
sprintf (' %u', DI(i))), 1:min(nk,n));
xlim (ax4_xlim); ylim (ax4_ylim);

set (findall ( gcf, '-property', 'FontSize'), 'FontSize', 7)
Expand Down Expand Up @@ -1486,7 +1483,7 @@
df(Nm+i) = prod (df(I-1));
termcols(1+Nm+i) = prod (df(I-1) + 1);
tmp = ones (n,1);
for j = 1:numel(I);
for j = 1:numel(I)
tmp = num2cell (tmp, 1);
for k = 1:numel(tmp)
tmp{k} = bsxfun (@times, tmp{k}, X{I(j)});
Expand Down
Binary file modified matlab/statistics-resampling.mltbx
Binary file not shown.
10 changes: 9 additions & 1 deletion matlab/statistics-resampling.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
<configuration build-checksum="2451036051" file="Y:\Documents\GitHub\statistics-resampling\matlab\statistics-resampling.prj" location="Y:\Documents\GitHub\statistics-resampling\matlab" name="statistics-resampling" target="target.toolbox" target-name="Package Toolbox">
<configuration build-checksum="2919770292" file="Y:\Documents\GitHub\statistics-resampling\matlab\statistics-resampling.prj" location="Y:\Documents\GitHub\statistics-resampling\matlab" name="statistics-resampling" target="target.toolbox" target-name="Package Toolbox">
<param.appname>statistics-resampling</param.appname>
<param.authnamewatermark>Andrew Penn</param.authnamewatermark>
<param.email>[email protected]</param.email>
Expand Down Expand Up @@ -53,6 +53,10 @@
</fileset.rootdir>
<fileset.rootfiles>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot.mexa64</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot.mexmaci64</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot.mexw32</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot.mexw64</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\boot1way.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\bootbayes.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\bootcdf.m</file>
Expand All @@ -70,6 +74,10 @@
<file>Y:\Documents\GitHub\statistics-resampling\inst\sampszcalc.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmad.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmedian.m</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmedian.mexa64</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmedian.mexmaci64</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmedian.mexw32</file>
<file>Y:\Documents\GitHub\statistics-resampling\inst\smoothmedian.mexw64</file>
</fileset.rootfiles>
<fileset.depfun.included />
<fileset.depfun.excluded />
Expand Down

0 comments on commit a60e228

Please sign in to comment.