Skip to content

Commit fa5f1a4

Browse files
Improved example in corrNominal.m
1 parent a62d1ff commit fa5f1a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

toolbox/multivariate/corrNominal.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
%}
408408

409409
%{
410-
% Example of option datamatrix combined with X defined as table.
410+
Example of option datamatrix combined with X defined as table.
411411
% Initial contingency matrix (2D array).
412412
N=[75 126
413413
76 203
@@ -416,6 +416,7 @@
416416
24 110
417417
41 222
418418
19 141];
419+
% The sample size n is 1367
419420
% Labels of the contingency matrix
420421
Party={'ACTIVIST DEMOCRATIC', 'DEMOCRATIC', ...
421422
'SIMPATIZING DEMOCRATIC', 'INDEPENDENT', ...
@@ -424,12 +425,13 @@
424425
DeathPenalty={'AGAINST' 'FAVORABLE'};
425426
Ntable=array2table(N,'RowNames',Party,'VariableNames',DeathPenalty);
426427
% From the contingency table reconstruct, the original data matrix now
427-
% using FSDA function.
428-
% The output is a cell array.
428+
% using FSDA function crosstab2datamatrix.
429+
% The output of the call to crosstab2datamatrix is a cell array.
429430
Xcell=crosstab2datamatrix(Ntable);
431+
% Xtable contains 1367 rows (sample size).
430432
Xtable=cell2table(Xcell);
431-
% call function corrNominal using first argument as input data matrix
432-
% in table format and option datamatrix set to true
433+
% Call to function corrNominal using first argument as input data matrix
434+
% (in table format) and option datamatrix set to true
433435
out=corrNominal(Xtable,'datamatrix',true);
434436
%}
435437

0 commit comments

Comments
 (0)