|
407 | 407 | %} |
408 | 408 |
|
409 | 409 | %{ |
410 | | - % Example of option datamatrix combined with X defined as table. |
| 410 | + Example of option datamatrix combined with X defined as table. |
411 | 411 | % Initial contingency matrix (2D array). |
412 | 412 | N=[75 126 |
413 | 413 | 76 203 |
|
416 | 416 | 24 110 |
417 | 417 | 41 222 |
418 | 418 | 19 141]; |
| 419 | + % The sample size n is 1367 |
419 | 420 | % Labels of the contingency matrix |
420 | 421 | Party={'ACTIVIST DEMOCRATIC', 'DEMOCRATIC', ... |
421 | 422 | 'SIMPATIZING DEMOCRATIC', 'INDEPENDENT', ... |
|
424 | 425 | DeathPenalty={'AGAINST' 'FAVORABLE'}; |
425 | 426 | Ntable=array2table(N,'RowNames',Party,'VariableNames',DeathPenalty); |
426 | 427 | % 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. |
429 | 430 | Xcell=crosstab2datamatrix(Ntable); |
| 431 | + % Xtable contains 1367 rows (sample size). |
430 | 432 | 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 |
433 | 435 | out=corrNominal(Xtable,'datamatrix',true); |
434 | 436 | %} |
435 | 437 |
|
|
0 commit comments