Skip to content

Commit f791c00

Browse files
author
acp29
committed
minor bug fix
- fixed broadcast warning in smoothmedian - fixed MarkerFace warning in Octave
1 parent 8c8bf81 commit f791c00

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

inst/bootnhst.m

+9-9
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,18 @@
452452

453453
% Plot graph of the difference in bootfun for each comparison with 95% confidence intervals
454454
figure;
455-
nc = size(c,1); % Calculate number of comparisons to plot
456-
plot([0;0],[0;nc+1]','k:'); % Plot vertical dashed line at 0 effect
457-
set(gca,'Ydir','reverse') % Flip y-axis direction
458-
ylim([0.5,nc+0.5]); % Set y-axis limits
459-
hold on % Enable plotting new data on the same axis
455+
nc = size(c,1); % Calculate number of comparisons to plot
456+
plot([0;0],[0;nc+1]','k:'); % Plot vertical dashed line at 0 effect
457+
set(gca,'Ydir','reverse') % Flip y-axis direction
458+
ylim([0.5,nc+0.5]); % Set y-axis limits
459+
hold on % Enable plotting new data on the same axis
460460
for i=1:nc
461461
if c(i,7) < 0.05
462-
plot(c(i,5),i,'or','MarkerFace','r') % Plot marker for the difference in bootfun
463-
plot([c(i,8),c(i,9)],i*ones(2,1),'r-') % Plot line for each confidence interval
462+
plot(c(i,5),i,'or','MarkerFaceColor','r') % Plot marker for the difference in bootfun
463+
plot([c(i,8),c(i,9)],i*ones(2,1),'r-') % Plot line for each confidence interval
464464
else
465-
plot(c(i,5),i,'ob','MarkerFace','b') % Plot marker for the difference in bootfun
466-
plot([c(i,8),c(i,9)],i*ones(2,1),'b-') % Plot line for each confidence interval
465+
plot(c(i,5),i,'ob','MarkerFaceColor','b') % Plot marker for the difference in bootfun
466+
plot([c(i,8),c(i,9)],i*ones(2,1),'b-') % Plot line for each confidence interval
467467
end
468468
end
469469
hold off

inst/param/smoothmedian.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,10 @@
254254
xj = (x(j(q),:) - h) .*...
255255
midrange(ones(1,l),:) +...
256256
centre(ones(1,l),:); % backtransform data when recreating xj
257+
tmp = p(ones(l,1),:);
257258
% Calculate standard error(s) for the computed value(s) of the smoothed median
258-
v0 = (1/(m*(m-1))) * sum((((xi-p).^2+(xj-p).^2).^(-3/2) .* (xi-xj).^2));
259-
v = (1/(m*(m-1))) * sum(((xi+xj-2*p)./(((xi-p).^2+(xj-p).^2).^(0.5))).^2);
259+
v0 = (1/(m*(m-1))) * sum((((xi-tmp).^2+(xj-tmp).^2).^(-3/2) .* (xi-xj).^2));
260+
v = (1/(m*(m-1))) * sum(((xi+xj-2*tmp)./(((xi-tmp).^2+(xj-tmp).^2).^(0.5))).^2);
260261
stderr = sqrt((v0.^(-2)) .* v / m);
261262
% Assign 0 to stderr for x columns with 0 variance
262263
stderr(midrange==0) = 0;

0 commit comments

Comments
 (0)