Skip to content

Commit

Permalink
Example added to balloonplot
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoRianiUNIPR committed Jan 2, 2025
1 parent a42bcfd commit aa4d5e9
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 29 deletions.
24 changes: 23 additions & 1 deletion toolbox/graphics/balloonplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
% size IxJ the balloon plots shows circles which are
% proportional to the absolute values of this matrix.
% Example - 'contrib2Chi2',true
% Data Types - boolean
% Data Types - boolean or array or table of the same size of N
%
% datamatrix : Data matrix or contingency table. Boolean. If
% datamatrix is true the first input argument N is forced to
Expand Down Expand Up @@ -202,6 +202,16 @@
balloonplot(SportHealth,'contrib2Index',out.Contrib2CminusD)
%}

%{
%% Example where contrib2Index is a table.
load SportHealth.mat
out=corrNominal(SportHealth);
out.Contrib2Hyxtable
% Contribution to Hyx index from each cell of the table
balloonplot(SportHealth,'contrib2Index', out.Contrib2Hyxtable)
title(['Contribution of each single cell to Hyx=' num2str(out.Hyx(1))])
%}

%% Beginning of code

% Check whether N is a contingency table or a n-by-p input dataset (in this
Expand Down Expand Up @@ -333,6 +343,18 @@
% squared Pearson residuals
Res2=round(Res2,2);
else
% Check that the size of Contrib2Index is IxJ
if ~isequal(size(contrib2Index),[I J])
disp("Size of current contingency table")
disp([I,J])
disp("Size of Contrib2Index")
disp(size(contrib2Index))
error('FSDA:balloonplot:WrongInputOpt','Size of Contrib2Index must be equal to the current contingency table.');
end

if istable(contrib2Index)
contrib2Index=contrib2Index{:,:};
end
Res2=contrib2Index;
boopos=Res2(:)>0;
booneg=Res2(:)<0;
Expand Down
118 changes: 90 additions & 28 deletions toolbox/helpfiles/FSDA/balloonplot.html

Large diffs are not rendered by default.

Binary file modified toolbox/helpfiles/FSDA/images/balloonplot_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified toolbox/helpfiles/FSDA/images/balloonplot_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified toolbox/helpfiles/FSDA/images/balloonplot_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified toolbox/helpfiles/FSDA/images/balloonplot_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added toolbox/helpfiles/FSDA/images/balloonplot_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa4d5e9

Please sign in to comment.