CorAnaplot draws the Correspondence Analysis (CA) graphs with confidence ellipses.
Prepare the data.
N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; % Compute Correspondence analysis else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % Compute correspondence analysis out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false); % Show the correspondence analysis plot. % Rows and columns are shown in principal coordinates CorAnaplot(out)
close all % Prepare the data. N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; % Compute Correspondence analysis else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % Six-pointed star (hesagram) for supplementary rows SymbolRows='h'; % Five-pointed star (pentagram) for supplementary rows SymbolRowsSup='p'; % Color for active rows ColorRows='b'; % Color for supplementary rows (dark blue) ColorRowsSup=[6 13 123]/255; % Blue fill color for active rows MarkerFaceColorRows='b'; % Right-pointing triangle for active columns Symbolcols='^'; % Six-pointed star (hexagram) for supplementary columns SymbolcolsSup='h'; % Color for active columns ColorCols='r'; % Red fill color for active rows MarkerFaceColorCols='r'; % Color for supplementary columns (dark red) ColorColsSup=[128 0 0]/255; plots=struct; plots.SymbolRows=SymbolRows; plots.SymbolRowsSup=SymbolRowsSup; plots.ColorRows=ColorRows; plots.ColorRowsSup=ColorRowsSup; plots.MarkerFaceColorRows=MarkerFaceColorRows; plots.SymbolCols=Symbolcols; plots.SymbolColsSup=SymbolcolsSup; plots.ColorCols=ColorCols; plots.ColorColsSup=ColorColsSup; plots.MarkerFaceColorCols=MarkerFaceColorCols; % change the sign of the second dimension changedimsign=[false true]; out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false); CorAnaplot(out,'plots',plots,'changedimsign',changedimsign)
close all % Prepare the data. N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; % Compute Correspondence analysis else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % No horizontal displacement for the labels. addx=0; out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false); CorAnaplot(out,'addx',addx)
N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % Superimpose confidence ellipses for rows 2 and 4 and for column 3 confellipse=struct; confellipse.selRows=[2 4]; % Ellipse for column 3 using an integer confellipse.selCols=3; % Ellipse for column 3 using a Boolean vector confellipse.selCols=[ false false true false false]; % confellipse.selCols={'c3'}; % Use the 3 methods below in order to compute the confidence ellipses for % the selected rows and columns of the input contingency table confellipse.method={'multinomial' 'bootRows' 'bootCols'}; % Set number of simulations confellipse.nsimul=500; % Set confidence interval confellipse.conflev=0.50; out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false); % Draw correspondence analysis plot with requested confidence ellipses CorAnaplot(out,'plots',1,'confellipse',confellipse)
N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % Superimpose confidence ellipses confellipse=struct; % No confidence ellipse for row points confellipse.selRows=[]; % Ellipse for all the column points using a Boolean vector confellipse.selCols=[ true true true true true]; % Compare methods 'multinomial' and 'bootCols' confellipse.method={'multinomial' 'bootCols'}; % Set number of simulations confellipse.nsimul=10000; % Set confidence interval confellipse.conflev=0.90; out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false); % Draw correspondence analysis plot with requested confidence ellipses CorAnaplot(out,'plots',1,'confellipse',confellipse)
N=[51 64 32 29 17 59 66 70; 53 90 78 75 22 115 117 86; 71 111 50 40 11 79 88 177; 1 7 5 5 4 9 8 5; 7 11 4 3 2 2 17 18; 7 13 12 11 11 18 19 17; 21 37 14 26 9 14 34 61; 12 35 19 6 7 21 30 28; 10 7 7 3 1 8 12 8; 4 7 7 6 2 7 6 13; 8 22 7 10 5 10 27 17; 25 45 38 38 13 48 59 52; 18 27 20 19 9 13 29 53; 35 61 29 14 12 30 63 58; 2 4 3 1 4 nan nan nan ; 2 8 2 5 2 nan nan nan; 1 5 4 6 3 nan nan nan; 3 3 1 3 4 nan nan nan]; % rowslab = cell containing row labels rowslab={'money','future','unemployment','circumstances',... 'hard','economic','egoism','employment','finances',... 'war','housing','fear','health','work','comfort','disagreement',... 'world','to_live'}; % colslab = cell containing column labels colslab={'unqualified','cep','bepc','high_school_diploma','university',... 'thirty','fifty','more_fifty'}; if verLessThan('matlab','8.2.0')==0 tableN=array2table(N,'VariableNames',colslab,'RowNames',rowslab); % Extract just active rows Nactive=tableN(1:14,1:5); Nsupr=tableN(15:18,1:5); Nsupc=tableN(1:14,6:8); Sup=struct; Sup.r=Nsupr; Sup.c=Nsupc; else Nactive=N(1:14,1:5); Lr=rowslab(1:14); Lc=colslab(1:5); Sup=struct; Sup.r=N(15:end,1:5); Sup.Lr=rowslab(15:end); Sup.c=N(1:14,6:8); Sup.Lc=colslab(6:8); end % Superimpose ellipses confellipse=struct; % Ellipse for the first 3 row points confellipse.selRows=1:3; % Ellipse for selected column points using a Boolean vector confellipse.selCols=[ false false true true false]; % Compare methods 'multinomial' and 'bootCols' confellipse.method={'multinomial' 'bootCols'}; % Set number of simulations confellipse.nsimul=10000; % Set confidence interval confellipse.conflev=0.90; d1=3; d2=4; out=CorAna(Nactive,'Sup',Sup,'plots',0,'dispresults',false,'d1',d1,'d2',d2); % Draw correspondence analysis plot with requested confidence ellipses CorAnaplot(out,'plots',1,'confellipse',confellipse,'d1',d1,'d2',d2)
In this example we compare the results which are obtained using option plots.alpha='colprincipal'; (which implicitly implies alpha=0) with those which come out imposing directly plots.alpha=0.
load smoke [N,~,~,labels]=crosstab(smoke{:,1},smoke{:,2}); [I,J]=size(N); labels_rows=labels(1:I,1); labels_columns=labels(1:J,2); out=CorAna(N,'Lr',labels_rows,'Lc',labels_columns,'plots',0,'dispresults',false); plots=struct; plots.alpha='rowgab'; plots.alpha='colgab'; plots.alpha='rowgreen'; plots.alpha='colgreen'; % Add confidence ellipses confellipse=1; plots.alpha='bothprincipal'; plots.alpha='rowprincipal'; plots.alpha='colprincipal'; h1=subplot(1,2,1); CorAnaplot(out,'plots',plots,'confellipse',confellipse,'h',h1) h2=subplot(1,2,2); plots.alpha=0; CorAnaplot(out,'plots',plots,'confellipse',confellipse,'h',h2);
load car out=CorAna(car,'plots',0); plots=struct; % Color of Row labels proportional to the amount of inertia which is % explained by the the two latent dimensions (communalities) plots.ColorMapLabelRows= 'CntrbDim2In'; CorAnaplot(out,'plots',plots)
out
— Structure containing the output of function CorAna.
Structure.Structure containing the following fields.
Value | Description |
---|---|
Lr |
cell of length $I$ containing the labels of active rows (i.e. the rows which participated to the fit). |
Lc |
cell of length $J$ containing the labels of active columns (i.e. the columns which participated to the fit). |
n |
Grand total. out.n is equal to sum(sum(out.N)). This is the number of observations. |
Dr |
Square matrix of size $I$ containing on the diagonal the row masses. This is matrix $D_r$. \[ D_r=diag(r) \] |
Dc |
Square matrix of size $J$ containing on the diagonal the column masses. This is matrix $D_c$. \[ D_c=diag(c) \] |
InertiaExplained |
matrix with 4 columnn. - First column contains the singular values (the sum of the squared singular values is the total inertia). - Second column contains the eigenvalues (the sum of the eigenvalues is the total inertia). - Third column contains the variance explained by each latent dimension. - Fourth column contains the cumulative variance explained by each dimension. |
LrSup |
cell containing the labels of the supplementary rows (i.e. the rows whicg did not participate to the fit). |
LcSup |
cell containing the labels of supplementary columns (i.e. the columns which did not participate to the fit). |
SupRowsN |
matrix of size length(LrSup)-by-c referred to supplementary rows. If there are no supplementary rows this field is not present. |
SupColsN |
matrix of size r-by-length(LcSup) referred to supplementary columns. If there are no supplementary columns this field is not present. |
RowsPriSup |
Principal coordinates of supplementary rows. If there are no supplementary rows this field is not present. |
RowsStaSup |
Standard coordinates of supplementary rows. If there are no supplementary rows this field is not present. |
RowsSymSup |
Symmetrical coordinates of supplementary rows. If there are no supplementary rows this field is not present. |
ColsPriSup |
Principal coordinates of supplementary columns. If there are no supplementary columns this field is not present. |
ColsStaSup |
Standard coordinates of of supplementary columns. If there are no supplementary columns this field is not present. |
ColsSymSup |
Symmetrical coordinates of supplementary columns. If there are no supplementary columns this field is not present. |
OverviewRows |
$I$-times-(k*3+2) table containing an overview of row points. More precisely, if we suppose that $k=2$, First column contains the row masses (vector $r$). Second column contains the scores of first dimension. Third column contains the scores of second dimension. Fourth column contains the inertia of each point, where inertia of point is the squared distance of point $d_i^2$ to the centroid. Fifth column contains the relative contribution of each point to the explanation of the inertia of the first dimension. The sum of the elements of this column is equal to 1. Sixth column contains the relative contribution of each point to the explanation of the inertia of the second dimension. The sum of the elements of this column is equal to 1. Seventh column contains the relative contribution of the first dimension to the explanation of the inertia of the point. Eight column contains the relative contribution of the second dimension to the explanation of the inertia of the point. |
OverviewCols |
$J$-times-(k*3+2) table containing an overview of row points. More precisely if we suppose that $k=2$ First column contains the column masses (vector $c$). Second column contains the scores of first dimension. Third column contains the scores of second dimension. Fourth column contains the inertia of each point, where inertia of point is the squared distance of point $d_i^2$ to the centroid. Fifth column contains the relative contribution of each point to the explanation of the inertia of the first dimension. The sum of the elements of this column is equal to 1. Sixth column contains the relative contribution of each point to the explanation of the inertia of the second dimension. The sum of the elements of this column is equal to 1. Seventh column contains the relative contribution of the first dimension to the explanation of the inertia of the point. Eight column contains the relative contribution of the second dimension to the explanation of the inertia of the point. |
Data Types: struct
Specify optional comma-separated pairs of Name,Value
arguments.
Name
is the argument name and Value
is the corresponding value. Name
must appear
inside single quotes (' '
).
You can specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'plots',plots=struct; plots.colorcols='k'
, 'addx',0.01
, 'addy',0.01
, 'changedimsign', [true false]
, 'confellipse', 0
, 'xlimx',[-1 1]
, 'ylimy',[0 1]
, 'd1',2
, 'd2',3
,'h',h1 where h1=subplot(2,1,1)
plots
—Customize plot appearance.scalar | structure.If plots is not a structure, a plot which shows the Principal coordinates of rows and columns is shown on the screen. If plots is a structure it may contain the following fields:
Value | Description |
---|---|
alpha |
type of plot, scalar in the interval [0 1] or a string identifying the type of coordinates to use in the plot. If $plots.alpha='rowprincipal'$ the row points are in principal coordinates and the column coordinates are standard coordinates. Distances between row points are (approximated) chi-squared distances (row-metric-preserving). The position of the row points are at the weighted average of the column points. Note that 'rowprincipal' can also be specified setting plots.alpha=1. If $plots.alpha='colprincipal'$, the column coordinates are referred to as principal coordinates and the row coordinates as standard coordinates. Distances between column points are (approximated) chi-squared distances (column-metric-preserving). The position of the column points are at the weighted average of the row points. Note that 'colprincipal' can also be specified setting plots.alpha=0. If $plots.alpha='symbiplot'$, the row and column coordinates are scaled similarly. The sum of weighted squared coordinates for each dimension is equal to the corresponding singular values. These coordinates are often called symmetrical coordinates. This representation is particularly useful if one is primarily interested in the relationships between categories of row and column variables rather than in the distances among rows or among columns. 'symbiplot' can also be specified setting plots.alpha=0.5; If $plots.alpha='bothprincipal'$, both the rows and columns are depicted in principal coordinates. Such a plot is often referred to as a symmetrical plot or French symmetrical model. Note that such a symmetrical plot does not provide a feasible solution in the sense that it does not approximate matrix $D_r^{-0.5}(P-rc')D_c^{-0.5}$. If $plots.alpha='bothstandard'$, both the rows and columns are depicted in standard coordinates. The standard coordinates are the principal coordinates divided by the corresponding singular values. If $plots.alpha='rowgab'$, rows are in principal coordinates and columns are in standard coordinates multiplied by the mass. This biplot has been suggested by Gabriel and Odoroff (1990). If $plots.alpha='colgab'$, columns are in principal coordinates and rows are in standard coordinates multiplied by the mass. This biplot has been suggested by Gabriel and Odoroff (1990). If $plots.alpha='rowgreen'$, rows are in principal coordinates and columns are in standard coordinates multiplied by square root of the mass. This biplot has been suggested by Greenacre and incorporates the contribution of points. In this display, points that contribute very little to the solution, are close to the center of the biplot and are relatively unimportant to the interpretation. This biplot is often referred as contribution biplot because it visually shows the most contributing points (Greenacre 2006b). If $plots.alpha='colgreen'$, columns in principal coordinates and rows in standard coordinates multiplied by the square root of the mass. This biplot has been suggested by Greenacre and incorporates the contribution of points. In this display, points that contribute very little to the solution, are close to the center of the biplot and are relatively unimportant to the interpretation. This biplot is often referred as contribution biplot because it shows visually the most contributing points (Greenacre 2006b). If $plots.alpha=scalar$ in the interval [0 1], row coordinates are given by $D_r^{-1/2} U \Gamma^\alpha$ and column coordinates are given by $D_c^{-1/2} V \Gamma^{1-\alpha}$. Note that for any choice of $\alpha$ the matrix product $ D_r^{-1/2} U \Gamma^\alpha (D_c^{-1/2} V \Gamma^{1-\alpha})^T$ optimally approximates matrix $D_r^{-0.5}(P-rc')D_c^{-0.5}$, in the sense that the sum of squared differences between $D_r^{1/2} D_r^{-1/2} U \Gamma^\alpha (D_c^{-1/2} V \Gamma^{1-\alpha})^T D_c^{1/2}$ and $D_r^{-0.5}(P-rc')D_c^{-0.5}$ is as small as possible. |
FontSize |
scalar which specifies the font size of row (column) labels. The default value is 10. |
FontSizeSup |
scalar which specifies the font size of row (column) labels of supplementary points. The default value is 10. |
MarkerSize |
scalar which specifies the marker size of symbols associated with rows or columns. The default value is 10. |
SymbolRows |
character which specifies the symbol to use for row points. If this field is not present the default symbols is 'o'. |
SymbolCols |
character which specifies the symbol to use for column points. If this field is not present the default symbols is '^'. |
SymbolRowsSup |
character which specifies the symbol to use for supplementary row points. If this field is not present the default symbols is 'o'. |
SymbolColsSup |
character which specifies the symbol to use for supplementary column points. If this field is not present the default symbols is '^'. |
ColorRows |
character which specifies the symbol to use for row points or RGB triplet. If this field is not present the default color is 'b'. |
ColorMapLabelRows |
character or cell which specifies whether the color of row labels must depend on a colormap. ColorMapLabelRows can be any of the VariableNames of out.OverviewRows. For example if ColorMapLabelRows=out.OverviewRows.Properties.VariableNames{1} it is possible to obtain a colormap where row labels colors are proportional to the masses. If plots.ColorMapLabelRows='CntrbPnt2In' it is possible to have a colormap where row labels are proportional to the contribution of the row points to the inertia of the two latent dimensions. If plots.ColorMapLabelRows='CntrbDim2In' it is possible to have a colormap of the row labels proportional to the contribution of the two latent dimensions to the inertia of each point (communalities). The default is plots.ColorMapLabelRows='' that is row labels have the same colors. |
ColorCols |
character which specifies the symbol to use for column points or RGB triplet. If this field is not present the default color is 'r'. |
ColorMapLabelCols |
character or cell which specifies whether the color of column labels must depend on a colormap. ColorMapLabelCols can be any of the VariableNames of out.OverviewCols. For example if ColorMapLabelCols=out.OverviewCols.Properties.VariableNames{1} it is possible to obtain a colormap where row labels colors are proportional to the masses. If plots.ColorMapLabelCols='CntrbPnt2In' it is possible to have a colormap where column labels are proportional to the contribution of the column points to the inertia of the two latent dimensions. If plots.ColorMapLabelCols='CntrbDim2In' it is possible to have a colormap of the column labels proportional to the contribution of the two latent dimensions to the inertia of each point (communalities). The default is plots.ColorMapLabelCols='' that is column labels have the same colors. |
ColorRowsSup |
character which specifies the symbol to use for row points or RGB triplet. If this field is not present the default color is 'b'. |
ColorColsSup |
character which specifies the symbol to use for supplementary column points or RGB triplet. If this field is not present the default color is 'r'. |
MarkerFaceColorRows |
character which specifies the marker fill color to use for active row points or RGB triplet. If this field is not present the default color is 'auto'. |
MarkerFaceColorCols |
character which specifies the marker fill color to use for active column points or RGB triplet. If this field is not present the default color is 'auto'. |
MarkerFaceColorRowsSup |
character which specifies the marker fill color to use for supplementary row points or RGB triplet. If this field is not present the default color is 'auto'. |
MarkerFaceColorColsSup |
character which specifies the marker fill color to use for supplementary column points or RGB triplet. If this field is not present the default color is 'auto'. |
Example: 'plots',plots=struct; plots.colorcols='k'
Data Types: double
addx
—horizontal displacement for labels.scalar | empty.Amount of horizontal displacement which has been put on the labels in the plot. The default value of addx (addx is empty) is (max(x)-min(x))/50.
Example: 'addx',0.01
Data Types: double
addy
—vertical displacement for labels.scalar.Amount of vertical displacement which has been put on the labels in the plot. The default value of addy is 0.
Example: 'addy',0.01
Data Types: double
changedimsign
—change chosen dimension sign.boolean vector of length 2.Sometimes for better interpretability it is necessary to change the sign of the coordinates for the chosen dimension. If changedimsign(1) is true the sign of the coordinates for first chosen dimension is changed. If changedimsign(2) is true the sign of the coordinates for first chosen dimension is changed. As default the dimensions are the first and the second however, they can be changed using option plots.dim. The default value of changedimsign is [false false] that is the sign is not changed.
Example: 'changedimsign', [true false]
Data Types: boolean
confellipse
—confidence ellipses around rows and/or columns points.scalar | struct.If confellipse is 1, 90 per cent confidence ellipses are drawn around each row and column point based on multinomial method.
If confellipse is a struct it may contain the following fields.
Value | Description |
---|---|
conflev |
number in the interval (0 1) which defines the confidence level of each ellipse. If this field is not present 90 per cent confidence ellipses are shown |
method |
cell which specifies the method(s) to use to compute confidence ellipses. Possible values are: {'multinomial'} = in this case the original contingency table with the active elements is taken as a reference. Then new data tables are drawn in the following way: $r\times c$ values are drawn from a multinomial distribution with theoretical frequencies equals to $n_{ij}/n$ where $n$ is the sample size. {'bootRows'} = the values are bootstrapped row by row: Given row i, $n_{i.}$ are extracted with repetition and a frequency distribution is computed using classes $[0, n_{i1}]$,$[n_{i1}, n_{i1}+n_{i2}]$, $\ldots$ $[\sum_{j=1}^{J-1} n_{ij}, \sum_{j=1}^{J} n_{ij}$. {'bootCols'} = the values are bootstrapped column by column. If confellipse.method for example is {'bootRows' 'bootCols'} two ellipses are drawn for each point. In this case it is possible to appreciate the stability of both methods. If this field is not present {'multinomial'} method is used. |
nsimul |
scalar which defines the number of contingency tables which have to ge generated. The default value of confellipse.nsimul is 1000. Thus nsimul new contingency tables are projected as supplementary rows and/or supplementary columns. |
selRows |
vector which specifies for which row points it is necessary to draw the ellipses. confellipse.selRows either a boolean vector of length I containing a true in correspondence of the row elements for which the ellipse has to be drawn or a numeric vector which contains the indexes of the units which have to be drawn or a cell array containing the names of the rows for which the ellipse has to be drawn. For example if I=3 and the second row is called 'row2' in order to show just the confidence ellipse for this row it is possible to use confellipse.selRows=[false true false], or confellipse.selRows=2 or confellipse.selRows={'row2'}. |
selCols |
vector which specifies for which column points it is necessary to draw the ellipses. confellipse.selCols can be either a boolean vector of length J containing a true in correspondence of the column elements for which the ellipse has to be drawn or a numeric vector which contains the indexes of the columns which have to be drawn or a cell array containing the names of the columns for which the ellipse has to be drawn. For example if J=3 and one the third column is called 'Col3' in order to show just the confidence ellipse for this element it is possible to use confellipse.selCols=[false false true], or confellipse.selCols=3 or confellipse.selCols={'Col3'}. |
AxesEllipse |
boolean which specifies whether it is necessary to show the major axes of the ellipse. The default value of confellipse.AxesEllipse is true that is the axes are shown. |
Example: 'confellipse', 0
Data Types: scalar or struct
xlimx
—Min and Max of the x axis.vector.Vector with two elements controlling minimum and maximum of the x axis.
Example: 'xlimx',[-1 1]
Data Types: double
ylimy
—Min and Max of the y axis.vector.Vector with two elements controlling minimum and maximum of the y axis.
Example: 'ylimy',[0 1]
Data Types: double
d1
—Dimension to show on the horizontal axis.positive integer.Positive integer in the range 1, 2, .., K which indicates the dimension to show on the x axis. The default value of d1 is 1.
Example: 'd1',2
Data Types: single | double
d2
—Dimension to show on the vertical axis.positive integer.Positive integer in the range 1, 2, .., K which indicates the dimension to show on the y axis. The default value of d2 is 2.
Example: 'd2',3
Data Types: single | double
h
—the axis handle of a figure where to send the CorAnaplot.this can be used to host the CorAnaplot in a subplot of a complex figure formed by different panels (for example a panel with CorAnaplot from plots.alpha=0.2 and another with CorAnaplot from plots.alpha=0.5).
Example: 'h',h1 where h1=subplot(2,1,1)
Data Types: Axes object (supplied as a scalar)
Benzecri, J.-P. (1992), "Correspondence Analysis Handbook", New-York, Dekker.
Benzecri, J.-P. (1980), "L'analyse des donnees tome 2: l'analyse des correspondances", Paris, Bordas.
Greenacre, M.J. (1993), "Correspondence Analysis in Practice", London, Academic Press.
Gabriel, K.R. and Odoroff, C. (1990), Biplots in biomedical research, "Statistics in Medicine", Vol. 9, pp. 469-485.
Greenacre, M.J. (1993), Biplots in correspondence Analysis, "Journal of Applied Statistics", Vol. 20, pp. 251-269.
Riani, M, Atkinson A.C., Torti, F., Corbellini A. (2023), Robust Correspondence Analysis, "Journal of the Royal Statistical Society Series C: Applied Statistics", Vol. 71, pp. 1381–1401, https://doi.org/10.1111/rssc.12580
Urbano, L.-S., van de Velden, M. and Kiers, H.A.L. (2009), CAR: A MATLAB Package to Compute Correspondence Analysis with Rotations, "Journal of Statistical Software", Vol. 31.