Skip to content

Commit 6b85915

Browse files
committed
bootlm: changed sign of helmert contrasts
1 parent a87ec05 commit 6b85915

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

inst/bootlm.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@
253253
% is ideal for predictor variables that are either ordinal,
254254
% or nominal with their levels ordered such that the contrast
255255
% coding reflects tests of some hypotheses of interest about
256-
% the nested grouping of the predictor levels.
256+
% the nested grouping of the predictor levels. Note that the
257+
% the one-level predictor is the reference and is subtracted
258+
% from from the mean of the subsequent predictor levels.
257259
%
258260
% o 'effect': Deviation effect coding. The intercept represents
259261
% the grand mean. Each slope coefficient compares one level
@@ -1824,9 +1826,9 @@
18241826

18251827
% Create contrast matrix (of doubles) using Helmert coding contrasts
18261828
% These contrasts are orthogonal and centered (i.e. sum to 0)
1827-
C = bsxfun (@rdivide, ...
1828-
cat (1, diag ((N - 1):-1:1) + tril (-ones (N - 1), - 1), ...
1829-
-ones(1, N-1)), N:-1:2);
1829+
C = - bsxfun (@rdivide, ...
1830+
cat (1, diag ((N - 1):-1:1) + tril (-ones (N - 1), - 1), ...
1831+
-ones(1, N-1)), N:-1:2);
18301832

18311833
end
18321834

0 commit comments

Comments
 (0)