Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

MARG Call

evaluates marginal totals in a multiway contingency table

CALL MARG( locmar, marginal, dim, table, config);

The inputs to the MARG subroutine are as follows:

dim
specifies a vector containing the number of variables and the number of their possible levels in a contingency table. If dim is 1 ×v, then there are v variables, and the value of the ith element is the number of levels of the ith variable.

table
specifies an array containing the number of observations at each level of each variable. Variables are nested across columns and then across rows.

config
specifies an array containing the marginal totals to be evaluated. Each column specifies a distinct marginal.

locmar
returns a vector of indices to each new set of marginal totals specified by config. A marginal total is exhibited for each level of the specified marginal. These indices help locate particular totals.

marginal
returns a vector of marginal totals.

The matrix table must conform in size to the contingency table specified in dim. In particular, if table is n ×m, the product of the entries in the dim vector must equal nm. In addition, there must be some integer k such that the product of the first k entries in dim equals m. See the description of the IPF function for more information on specifying table.

For example, consider the no-three-factor-effect model for Bartlett's data as described in Bishop, Fienberg, and Holland (1975):

   dim={2 2 2};
   table={156   84   84  156,
          107  133   31  209};
   config={1 1 2,
           2 3 3};
   call marg(locmar,marginal,dim,table,config);
These statements return
        LOCMAR      1 row     3 cols  (numeric)

                      1       5       9

      MARGINAL    1 row    12 cols  (numeric)

   263     217     115     365     240     240     138
  :342     240     240     240     240

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.