nag_contab_binary_service (g11sb) is a service function which may be used prior to calling
nag_contab_binary (g11sa) to calculate the frequency distribution of a set of dichotomous score patterns.
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 22: |
n was made optional |
When each of
individuals responds to each of
dichotomous variables the data assumes the form of the matrix
defined below
where the
take the value of
or
and
, for
, denotes the score pattern of the
th individual.
nag_contab_binary_service (g11sb) calculates the number of different score patterns,
, and the frequency with which each occurs. This information can then be passed to
nag_contab_binary (g11sa).
None.
Exact.
This example counts the frequencies of different score patterns in the following list:
Score Patterns |
000 |
010 |
111 |
000 |
001 |
000 |
000 |
110 |
001 |
011 |
function g11sb_example
fprintf('g11sb example results\n\n');
x = [false, false, false;
false, true, false;
true, true, true;
false, false, false;
false, false, true;
false, false, false;
false, false, false;
true, true, false;
false, false, true;
false, true, true];
[ns, x, irl, ifail] = g11sb(x);
fprintf('Frequency Score pattern\n\n');
for i = 1:ns
fprintf('%5d ', irl(i));
fprintf('%2d', x(i,:));
fprintf('\n');
end