Abstract

For at least partially ordered three-way tables, it is well known how to arithmetically decompose Pearson's 𝑋2𝑃 statistic into informative components that enable a close scrutiny of the data. Similarly well-known are smooth models for two-way tables from which score tests for homogeneity and independence can be derived. From these models, both the components of Pearson's 𝑋2𝑃 and information about their distributions can be derived. Two advantages of specifying models are first that the score tests have weak optimality properties and second that identifying the appropriate model from within a class of possible models gives insights about the data. Here, smooth models for higher-order tables are given explicitly, as are the partitions of Pearson's 𝑋2𝑃 into components. The asymptotic distributions of statistics related to the components are also addressed.

1. Introduction

In [1, 2] it is shown how, for at least partially ordered three-way tables, to arithmetically decompose Pearson’s 𝑋2𝑃 statistic into informative components that enable a close scrutiny of the data. They focus on three-way tables as being indicative of higher-order tables. Here, we give models for arbitrary multiway tables that are at least partially ordered. We discuss the arithmetic decomposition of 𝑋2𝑃 into components, giving explicit formulae for these components. This enables 𝑋2𝑃 to be partitioned into meaningful 𝑋2-type statistics. Using extensions of models for two-way tables discussed in [3], the asymptotic distribution of statistics related to these components may be given.

At the onset, we should say what we mean by “ordered.’’ A random variable is a mapping from the sample space to the real line. It is ordered if and only if the ordering of the range is meaningful. So, for example, a range containing only zero and one, denoting male and female, would not usually be considered meaningful. However, it would usually be considered meaningful if the zero and one denoted low and high, respectively. A variable is ordered if and only if it reflects a random variable that is ordered rather than not ordered, or nominal. A table is completely ordered if and only if all variables are ordered. It is partially ordered if and only if at least one but not all variables are ordered.

To give precedence, we observe here that the arithmetic decomposition of Pearson’s 𝑋2𝑃 statistic for two- and three-way tables can be shown quite compactly using results from [3, Chapter 4, Theorems  2.1 and  2.2, pages 90-91 and Theorem  5.2, page 101]. It is shown there that for contingency tables Lancaster’s 𝜙2 is equal to the sum of the squares of the elements of a vector 𝜃 in the subsequent models. In a parallel manner, working with observed proportions {𝑁𝑖𝑗/𝑛}, it can be shown that 𝑋2𝑃 is equal to the sum of the squares of components. This observation applies to verifying the results in [1, 2]. Moreover, precedence should be given to the work in [3, Chapter 12] for material throughout this paper.

We also note that the work in [4] considered models for ordered two-way contingency tables. In [4, Chapter 3], an extended hypergeometric model is used when both row and column marginal totals are known. This is not a smooth model and here we will not discuss either it or its extensions further. In [4, Chapter 8], doubly ordered models are considered, and these will be generalised in Section 2 in what follows.

In treating a singly ordered table, the work in [4, Chapter 4] assumed the total count for each treatment is known before sighting the data, and this leads to a smooth product multinomial model. If the treatment totals are not known before sighting the data, the resulting model is a single multinomial with cell probabilities modelled the same way as when the treatment totals are known before sighting the data. The models in [1, 2] are single multinomials, following the second approach. However, it is clear that, in general, for partially ordered tables, there are a multitude of possible models, depending on which marginal totals are assumed known before sighting the data. In all cases, the logarithms of the likelihoods are, apart from unimportant constants, the same. Henceforth, we will consistently work with product multinomials and note that the distributional results developed apply to the multitude of models indicated.

The outline of this paper is as follows. In Section 2, the more routine case of completely ordered multiway tables is discussed. The balance of the paper is about the more complicated partially ordered tables. In Section 3, the work of [4] on partially ordered tables is reviewed. In Section 4, the work in [1, 2] is reviewed and extended using smooth models. Section 5 gives the generalizations to arbitrary multiway partially ordered tables.

2. Completely Ordered Multiway Tables

For an m-way 𝐼1×𝐼2×⋯×𝐼𝑚, completely ordered table of counts {𝑁𝑣1⋯𝑣𝑚}, Pearson’s 𝑋2𝑃 is given by

𝑋2𝑃=𝐼1𝑣1=1⋯𝐼𝑚𝑣𝑚=1𝑁𝑣1⋯𝑣𝑚−𝐸[𝑁𝑣1⋯𝑣𝑚]2𝐸𝑁𝑣1...𝑣𝑚.(2.1) An extension of the approach in [1] demonstrates that 𝑋2𝑃 has an arithmetic decomposition:

𝑋2𝑃=𝐼1𝑢−11=0⋯𝐼𝑚𝑢−1𝑚=0𝑍2𝑢1⋯𝑢𝑚,(2.2) in which the components 𝑍𝑢1⋯𝑢𝑚, 𝑢1=0,…,𝐼1−1,…, 𝑢𝑚=0,…,𝐼𝑚−1, are given by

𝑍𝑢1⋯𝑢𝑚=√𝑛𝐼1𝑣1=1⋯𝐼𝑚𝑣𝑚=1ğ‘Žğ‘¢1𝑣1î€¸â‹¯ğ‘Žğ‘¢ğ‘šî€·ğ‘£ğ‘šî€¸ğ‘ğ‘£1⋯𝑣𝑚.(2.3) Here ∑𝑛=𝐼1𝜈1=1⋯∑𝐼𝑚𝜈𝑚=1𝑁𝜈1⋯𝜈𝑚 and for 𝑗=1,…,𝑚, {ğ‘Žğ‘¢ğ‘—(•)} is orthonormal on {𝑝•⋯•𝑣𝑗•⋯•}, in which 𝑝𝑣1⋯𝑣𝑚 = 𝑁𝑣1⋯𝑣𝑚/𝑛 and 𝑝•⋯•𝑣𝑗•⋯• is obtained from 𝑝𝑣1⋯𝑣𝑚 by summing out all variables other than 𝑣𝑗. Furthermore, the orthonormal systems all have zeroth term identically one. This work builds on the iconic work of Oliver Lancaster, for which see [3], and [3, Chapter 12] in particular.

It is routine to show that the components 𝑍𝑢1⋯𝑢𝑚are asymptotically multivariate normal, since an arbitrary linear combination of these variables is asymptotically normal by the central limit theorem. Utilizing the orthonormality of the {ğ‘Žğ‘¢ğ‘—(•)}, it can be shown that all components have expectation zero, variance unity, and covariances zero. They are thus asymptotically mutually independent and asymptotically standard normal.

One possible smooth model for {𝑁𝑣1⋯𝑣𝑚} is the multinomial with count total n and cell probabilities {𝑝𝜈1⋯𝜈𝑚} given by

𝑝𝜈1⋯𝜈𝑚=𝐼1𝑢−11=0⋯𝐼𝑚𝑢−1𝑚=0𝜃𝑢1â‹¯ğ‘¢ğ‘šğ‘Žğ‘¢1𝑣1î€¸â‹¯ğ‘Žğ‘¢ğ‘šî€·ğ‘£ğ‘šî€¸î‚‡ğ‘ğœˆ1•⋯•⋯𝑝•⋯•𝜈𝑚,(2.4) in which 𝜃0⋯0=1 and 𝜃0⋯0𝑢𝑗0⋯0=0 for all 𝑢𝑗≥1. This model includes all genuine two, three, and so forth m-way independence models. A routine extension of [4, Theorem  8.1] shows that the score test statistic for testing, that the 𝜃𝑢1⋯𝑢𝑚are collectively zero against the negation of this is, as before, the sum of the squares of the 𝑍𝑢1⋯𝑢𝑚. Moreover, these components have the distributional properties given in the previous paragraph. Generalising [4, Theorem  8.2], this score test statistic is 𝑋2𝑃. The score test has the advantage of weak optimality: see, for example, [5]. An additional advantage of this approach is that it can be shown that 𝑍2𝑢1⋯𝑢𝑚 is the score test statistic when testing 𝜃𝑢1⋯𝑢𝑚=0 against 𝜃𝑢1⋯𝑢𝑚≠0 in an appropriate model. Thus, in an informal sense, every 𝑍𝑢1⋯𝑢𝑚 is a detector of the corresponding 𝜃𝑢1⋯𝑢𝑚.

The degrees of freedom associated with 𝑋2𝑃 are the number of 𝜃𝑢1⋯𝑢𝑚 (and hence 𝑍𝑢1⋯𝑢𝑚) in the model, excluding those that are by convention always zero or one. The degrees of freedom are thus

𝑖<𝑗𝐼𝑖𝐼−1𝑗+−1𝑖<𝑗<𝑘𝐼𝑖𝐼−1𝑗𝐼−1𝑘𝐼−1⋯+1𝐼−12⋯𝐼−1𝑚−1=𝐼1×𝐼2×⋯×𝐼𝑚𝐼−1−1−𝐼−12𝐼−1−⋯−𝑚.−1(2.5) The left-hand side consists of the degrees of freedom associated with all genuine two-way, three-way, and so forth 𝑚-way models, while the right-hand side is the number of cells minus one for the constraint ∑𝑛=𝐼1𝜈1=1⋯∑𝐼𝑚𝜈𝑚=1𝑁𝜈1⋯𝜈𝑚 (reflecting that the sample size is known before sighting the data) minus the degrees of freedom associated with all one-way (essentially goodness of fit) models. For the happiness example in [1] 𝐼1=3, 𝐼2=4, 𝐼3=5 and substituting in the aforementioned formulae, there are 50 degrees of freedom.

3. Two-Way Singly Ordered Tables

  In [4, Section  4.4] two-way tables are discussed. We report on that discussion using our subsequent convention that ordered categories precede unordered categories. Tables {𝑁𝑤𝑧} are modelled by product multinomials, with the zth column being multinomial with total counts 𝑛•𝑧 and cell probabilities:

𝑝𝑤𝑧=1+𝐼1𝑢=1ğœƒğ‘¢ğ‘§ğ‘Žğ‘¢âˆš(𝑤)/𝑛•𝑧𝑝𝑤•,(3.1) for 𝑤=1,…,𝐼1−1. Note that the probabilities in the 𝐼1th row are found by difference: 𝑝𝐼1𝑧=1−𝑝1𝑧−⋯−𝑝(𝐼1−1)𝑧 and 𝑧=1,…,𝐼2, where 𝑝𝑤•=∑𝑧𝑁𝑤𝑧/𝑛 in which ∑𝑛=𝑤∑𝑧𝑁𝑤𝑧. The efficient score contains random variables 𝑍𝑢𝑧=√(𝑛/𝑛•𝑧)∑𝐼1𝑤=1ğ‘Žğ‘¢(𝑤)𝑝𝑤𝑧 and the information matrix is found to be singular. In order to find a score test statistic in [4, Section  4.4], the model is modified by removing the 𝜃s corresponding to the last column because the model is overparameterised: in any row, given the probabilities in the first 𝐼2−1 columns and the marginal probability for that row (the average of all probabilities in that row), the probability corresponding to the final column can be readily determined. A quicker approach is now outlined.

Write 𝑍𝑢=(𝑍𝑢1,…,𝑍𝑢𝐼2)T and 𝑍𝑇=(𝑍𝑇1,…,𝑍𝑇𝐼1−1). The 𝑛×𝑛 identity matrix is written as 𝐼𝑛; this will be clear from the context when this, and not the number of rows, and so forth, is intended. From the information matrix for 𝑍, the covariance matrix for 𝑍𝑢 is 𝐼𝐼2√−(ğ‘›â€¢ğ‘Žğ‘›â€¢ğ‘)/𝑛. This is idempotent of rank𝐼2−1. There exists an 𝐼2×(𝐼2−1) matrix A such that 𝐼𝐼2√−(ğ‘›â€¢ğ‘Žğ‘›â€¢ğ‘)/𝑛=𝐴𝐴𝑇 and 𝐴𝑇𝐴=𝐼𝐼2−1. We now focus on a smooth model containing just one value of u (the full model is similar). Since the information matrix in terms of 𝜃𝑢=(𝜃𝑢1,…,𝜃𝑢𝐼2)𝑇=𝜃 say is singular, define 𝜙 by 𝐴𝜙=𝜃. Then using the results of the lemma in [6, Section  3], the efficient score and information in terms of 𝜃 (𝑈𝜃 and 𝐼𝜃) and 𝜙 (𝑈𝜙 and 𝐼𝜙) are related by 𝑈𝜙=𝐴𝑇𝑈𝜃 and 𝐼𝜙=𝐴𝑇𝐼𝜃𝐴, respectively. It follows that since, in terms of 𝜙, the efficient score is 𝐴𝑇𝑍𝑢=𝑌𝑢 say, and the information matrix is 𝐴𝑇{𝐼𝐼2√−(ğ‘›â€¢ğ‘Žğ‘›â€¢ğ‘)/𝑛}𝐴=𝐼𝐼2−1, the score test statistic in terms of 𝜙 is 𝑌𝑇𝑢𝑌𝑢=𝑍𝑇𝑢{𝐼𝐼2√−(ğ‘›â€¢ğ‘Žğ‘›â€¢ğ‘)/𝑛}𝑍𝑢. Since 𝑌𝑢 is asymptotically N𝐼2−1(0,𝐼𝐼2−1), the score test statistic has the 𝜒2𝐼2−1 distribution, as is otherwise well known.

The columns of A are eigenvectors corresponding to the nonzero eigenvalues of {𝐼𝐼2√−(ğ‘›â€¢ğ‘Žğ‘›â€¢ğ‘)/𝑛}. The eigenvector corresponding to the zero eigenvalue is (1,…,1)𝑇, so a typical eigenvector may be written 1⟂. The elements of 𝑌𝑢=𝐴𝑇𝑍𝑢 are of the form 1𝑇⟂𝑍𝑢, that may fairly be called a contrast between the elements of 𝑍𝑢. They are mutually independent and standard normal. While the 𝑍𝑢𝑖 are immediately interpretable, they are slightly less convenient than 𝑌𝑢𝑖 that are orthogonal contrasts and are asymptotically mutually independent and asymptotically standard normal. These contrasts correspond to each order 𝑢, 𝑢=1,…,𝐼1−1, and reflect comparisons between the levels of the unordered factor. They may, for example, compare the means of the first two levels, the mean of the first two levels with that of the third level, the mean of the first three levels with that of the fourth level, and so on. Such contrasts may be described as Helmertian, from the Helmert matrix. In its simplest form, the Helmert matrix is an orthogonal (𝑛+1)×(𝑛+1) matrix with all the elements of the first row 1/p(𝑛+1) and 𝑟th row 1/p[𝑟(𝑟+1)] (r times), −𝑟/p[𝑟(𝑟+1)], then all zeros.

4. Three-Way Partially Ordered Tables

4.1. Singly Ordered Three-Way Tables

For singly ordered 𝐼1×𝐼2×𝐼3 tables, a product multinomial model is assumed, with the counts corresponding to the 𝑧1th column and 𝑧2th layer, 𝑧1=1,…,𝐼2 and 𝑧2=1,…,𝐼3, being multinomial with total counts 𝑛•𝑧1𝑧2 and cell probabilities:

𝑝𝑤𝑧1𝑧2=𝑝𝑤••𝐼1−1𝑢=0𝜃𝑢𝑧1𝑧2ğ‘Žğ‘¢(𝑤),(4.1) for 𝑤=1,…,𝐼1, in which 𝜃0𝑧1𝑧2=1. Here and henceforth, the normalisation corresponding to the √𝑛•𝑧 factor in 𝑝𝑤𝑧 in Section 3 is absorbed into the 𝜃𝑢𝑧1𝑧2. The components are random variables:

𝑍𝑢𝑧1𝑧2=𝑛𝑝•𝑧1•𝑝••𝑧2𝐼1𝑤=1ğ‘Žğ‘¢(𝑤)𝑝𝑤𝑧1𝑧2,(4.2) where 𝑝•𝑧1•=∑𝑤∑𝑧2𝑁𝑤𝑧1𝑧2/𝑛 and 𝑝••𝑧2=∑𝑤∑𝑧1𝑁𝑤𝑧1𝑧2/𝑛. The 𝑍𝑢𝑧1𝑧2 are immediately interpretable [2]), and, by the multivariate central limit theorem, are asymptotically multivariate normal. This does not depend on the smooth model. As in Section 3, for each u, 𝑢=1,…,𝐼1−1, we may construct orthogonal contrasts that are asymptotically mutually independent and asymptotically standard normal. These contrasts reflect 𝑢th moment comparisons between the levels of the unordered factors.

In [2], without a model, it is shown that 𝑋2𝑃 is the sum of the squares of the 𝑍𝑢𝑧1𝑧2:

𝑋2𝑃=𝐼1−1𝑢=0𝐼2𝑧1=1𝐼3𝑧2=1𝑍2𝑢𝑧1𝑧2.(4.3) In 𝑋2𝑃, it is insightful to separate components corresponding to 𝑢=0 and 𝑢≠0. Thus

𝑋2𝑃=𝐼2𝑧1=1𝐼3𝑧2=1𝑍20𝑧1𝑧2+𝐼1−1𝑢=1𝐼2𝑧1=1𝐼3𝑧2=1𝑍2𝑢𝑧1𝑧2.(4.4) The first summand corresponds to a two-way completely unordered table obtained by summing over rows and may reasonably be denoted by 𝑋2𝑍1𝑍2. The second summation corresponds to a genuinely three-way singly ordered table and may reasonably be denoted by 𝑋2𝑈𝑍1𝑍2.

In [2] it is stated that the degrees of freedom associated with 𝑋2𝑃 are 𝐼1𝐼2𝐼3−𝐼1−𝐼2−𝐼3+2. This follows because there are (𝐼2−1)(𝐼3−1) degrees of freedom associated with 𝑋2𝑍1𝑍2, and (𝐼1−1)(𝐼2𝐼3−1) degrees of freedom associated with 𝑋2𝑈𝑍1𝑍2.

We can argue for these degrees of freedom by, when possible, counting the 𝜃𝑢𝑧1𝑧2 or the 𝑍𝑢𝑧1𝑧2. The table corresponding to 𝑋2𝑍1𝑍2 is completely unordered, so there are no 𝜃𝑢𝑧1𝑧2 to count. We propose no smooth model, and our components are not appropriate when there is no order. However, the degrees of freedom are known independently to be (𝐼2−1)(𝐼3−1). The table corresponding to 𝑋2𝑈𝑍1𝑍2 has degrees of freedom (𝐼1−1)(𝐼2𝐼3−1) since this is the number of parameters 𝜃𝑢𝑧1𝑧2 in the smooth model. There are 𝐼2𝐼3 multinomials, each of which has (𝐼1−1) parameters 𝜃𝑢𝑧1𝑧2 as the multinomials probabilities sum to one (so the final cell probability is given by difference). In addition, one of the 𝐼2𝐼3 multinomials is determined by {𝑝𝑤••} and the remaining multinomials.

4.2. Doubly Ordered Three-Way Tables

For doubly ordered tables a product multinomial model is again assumed, with the counts corresponding to the 𝑧th layer being multinomial with total counts 𝑛••𝑧 and cell probabilities:

𝑝𝑤1𝑤2𝑧=𝑝𝑤1𝑤2•𝐼1𝑢−11=0𝐼2𝑢−12=0𝜃𝑢1𝑢2ğ‘§ğ‘Žğ‘¢1𝑤1î€¸ğ‘Žğ‘¢2𝑤2,(4.5) for 𝑤1=1,…,𝐼1, 𝑤2=1,…,𝐼2, and 𝑧=1,…,𝐼3, in which 𝜃00𝑧=𝜃𝑢10𝑧=𝜃0𝑢2𝑧=1. The components are random variables:

𝑍𝑢1𝑢2𝑧=𝑛𝑝••𝑧𝐼1𝑤1=1𝐼2𝑤2=1ğ‘Žğ‘¢1𝑤1î€¸ğ‘Žğ‘¢2𝑤2𝑝𝑤1𝑤2𝑧(4.6) for 𝑢1=0,…,𝐼1−1, 𝑢2=0,…,𝐼2−1, and 𝑧=1,…,𝐼3, where 𝑝••𝑧=∑𝑤1∑𝑤2𝑁𝑤1𝑤2z/𝑛. Again, by the multivariate central limit theorem, the 𝑍𝑢1𝑢2𝑧 are asymptotically multivariate normal. This does not depend on the smooth model. For each (𝑢1,𝑢2) pair, as in Section 3, we may construct orthogonal contrasts that are asymptotically mutually independent and asymptotically standard normal. These contrasts reflect bivariate moment comparisons between the levels of the unordered factor. A typical contrast may be (1st,2nd) moment differences between the first two levels reflected by layers.

In [2], without a model, it is shown that 𝑋2𝑃 is the sum of the squares of the 𝑍𝑢1𝑢2𝑧:

𝑋2𝑃=𝐼1𝑢−11=0𝐼2𝑢−12=0𝐼3𝑧=1𝑍2𝑢1𝑢2𝑧.(4.7) Again in 𝑋2𝑃, it is insightful to separate components corresponding to 𝑢𝑖=0 and 𝑢𝑖≠0. Thus,

𝑋2𝑃=𝐼3𝑧=1𝑍200𝑧+𝐼1𝑢−11=1𝐼3𝑧=1𝑍2𝑢10𝑧+𝐼2𝑢−12=1𝐼3𝑧=1𝑍20𝑢2𝑧+𝐼1𝑢−11=1𝐼2𝑢−12=1𝐼3𝑧=1𝑍2𝑢1𝑢2𝑧.(4.8) The first summand is identically zero. The second summand corresponds to a two-way singly ordered table obtained by summing over columns and may reasonably be denoted by 𝑋2𝑈1𝑍. The third summation corresponds to another two-way singly ordered table obtained by summing over rows and may reasonably be denoted by 𝑋2𝑈2𝑍. The final summation corresponds to a genuine three-way doubly ordered table and may reasonably be denoted by 𝑋2𝑈1𝑈2𝑍2.

In [2] it is incorrectly claimed that the associated degrees of freedom are, as in Section 4.1, 𝐼1𝐼2𝐼3−𝐼1−𝐼2−𝐼3+2. The one-way table corresponding to the components with 𝑢1=𝑢2=0 is uninformative, and should be ignored. The two-way tables corresponding to precisely one of the 𝑢1 or 𝑢2 zero are single-ordered, and, as in Section 3, have degrees of freedom (𝐼1−1)(𝐼3−1) and (𝐼2−1)(𝐼3−1), respectively. When neither 𝑢1 nor 𝑢2 is zero, the corresponding table is a genuine doubly ordered three-way table. There are 𝐼3 multinomials, each with (𝐼1−1)(𝐼2−1) parameters 𝜃𝑢1𝑢2𝑧 in their smooth model, but in fact the final of the 𝐼3 multinomials is determined by the {𝑝••𝑧} and the remaining multinomials. So there are (𝐼1−1)(𝐼2−1)(𝐼3−1) degrees of freedom for this final table. In all, the degrees of freedom are

𝐼1𝐼−12𝐼−13+𝐼−11𝐼−12+𝐼−11𝐼−13=𝐼−11𝐼2𝐼−13.−1(4.9)

We note that although the degrees of freedom in the Happiness Example of [2] are in error, the P values and conclusions with the correct degrees of freedom are as given there. We recommend the reader refer to this example, examined from two different perspectives in [1, 2], to see the insight and interpretability the components give to data analysis.

5. m-Way Partially Ordered Tables

We consider now an m-way table that is at least partially ordered: without loss of generality the first r (≥1) categorical variables are taken as ordered and the remaining 𝑠=𝑚−𝑟 (≥1) categorical variables are nominal. The notation reflects this convention; the subscripts w reflect ordered categories while the subscripts z reflect nominal categories. Accordingly, the table is denoted by {𝑁𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠}. As in [2] and [4, Chapter 4], we define components of the form

𝑍𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠=îƒŽğ‘›î€½ğ‘â€¢â‹¯â€¢ğ‘§1•⋯•×⋯×𝑝•⋯•𝑧𝑠𝐼1𝑤1=1⋯𝐼𝑟𝑤𝑟=1ğ‘Žğ‘¢1𝑤1î€¸â‹¯ğ‘Žğ‘¢ğ‘Ÿî€·ğ‘¤ğ‘Ÿî€¸ğ‘ğ‘¤1⋯𝑤𝑟𝑧1⋯𝑧𝑠,(5.1) where 𝑝𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠= 𝑁𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠/𝑛 and where {ğ‘Žğ‘¢ğ‘—(•)}, 𝑝•⋯•𝑧𝑗•⋯• and 𝑝𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠 are defined similarly to the above. Again, by the multivariate central limit theorem, the 𝑍𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠 are asymptotically multivariate normal. This does not depend on the smooth model.

By manipulations similar to those for the three-way case, it is possible to argue that

𝑋2𝑃=𝐼1𝑢−11=0⋯𝐼𝑟𝑢−1𝑟=0𝐼𝑟+1𝑧1=1⋯𝐼𝑚𝑧𝑠=1𝑍2𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠.(5.2) By separating components corresponding to 𝑢𝑖=0 and 𝑢𝑖≠0,𝑋2𝑃 can be partitioned as follows:

𝑋2𝑃=𝐼𝑟+1𝑧1=1⋯𝐼𝑚𝑧𝑠=1𝑍20⋯0𝑧1⋯𝑧𝑠+𝑟𝑖=1𝐼𝑖𝑢−1𝑖=1𝐼𝑟+1𝑧1=1⋯𝐼𝑚𝑧𝑠=1𝑍20⋯0𝑢𝑖0⋯0𝑧1⋯𝑧𝑠+𝑟𝑖,𝑗=1𝑖≠𝑗𝐼𝑖𝑢−1𝑖=1𝐼𝑗𝑢−1𝑗=1𝐼𝑟+1𝑧1=1⋯𝐼𝑚𝑧𝑠=1𝑍20⋯0𝑢𝑖0⋯0𝑢𝑗0⋯0𝑧1⋯𝑧𝑠++⋯𝐼1𝑢−11=1⋯𝐼𝑟𝑢−1𝑟=1𝐼𝑟+1𝑧1=1⋯𝐼𝑚𝑧𝑠=1𝑍2𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠.(5.3) If 𝑠=1, the first term corresponds to a noninformative one-way table and contributes zero to the sum. The following term corresponds to all (𝑠+1)-way singly ordered tables obtained by summing over 𝑟−1 ordered marginals and may reasonably be denoted by ∑𝑟𝑖=1𝑋2𝑈𝑖𝑍1⋯𝑍𝑠. The following term corresponds to all (𝑠+2)-way doubly ordered tables obtained by summing over 𝑟−2 ordered marginals and may reasonably be denoted by

𝑟𝑖,𝑗=1𝑖≠𝑗𝑋2𝑈𝑖𝑈𝑗𝑍1⋯𝑍𝑠.(5.4) The subsequent terms involve components with successively more ordered marginals and correspond to tables that are of increasing size. The final term corresponds to a genuine m-way r-fold ordered table and may reasonably be denoted by 𝑋2𝑈1⋯𝑈𝑟𝑍1⋯𝑍𝑠. Thus,

𝑋2𝑃=𝑟𝑖=1𝑋2𝑈𝑖𝑍1⋯𝑍𝑠+𝑟𝑖,𝑗=1𝑖≠𝑗𝑋2𝑈𝑖𝑈𝑗𝑍1⋯𝑍𝑠+⋯+𝑋2𝑈1⋯𝑈𝑟𝑍1⋯𝑍𝑠.(5.5)

The smooth model envisaged here is product multinomial where for each (𝑧1,…,𝑧𝑠), the observations follow a multinomial distribution with total counts 𝑛•⋯•𝑧1⋯𝑧𝑠 and cell probabilities {𝑝𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠} given by

𝑝𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠=𝑝𝑤1•⋯•×⋯×𝑝•⋯•𝑤𝑟•⋯•𝐼1𝑢−11=0⋯𝐼𝑟𝑢−1𝑟=0𝜃𝑢1⋯𝑢𝑟𝑧1â‹¯ğ‘§ğ‘ ğ‘Žğ‘¢1𝑤1î€¸â‹¯ğ‘Žğ‘¢ğ‘Ÿî€·ğ‘¤ğ‘Ÿî€¸î‚‡.(5.6)

An extension of the approach in [4, Section  4.4] investigates testing if the 𝜃𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠are collectively zero against the negation of this. Generalising the work in [4, Section  4.4], the efficient score statistic is 𝑍𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠. The information matrix is block diagonal but each block is singular. Nevertheless, the efficient score is asymptotically normal and appropriate orthogonal contrasts are asymptotically mutually independent and standard normal.

The degrees of freedom may be deduced either by counting 𝜃𝑢1⋯𝑢𝑟𝑧1⋯𝑧𝑠 (or the corresponding components), or by the arguments in [2]. Consider a genuine m-way table with the first r categories ordered and the remaining 𝑠=𝑚−𝑟 categories not ordered. This includes tables corresponding to 𝑋2𝑈𝑖𝑈𝑗𝑍1⋯𝑍𝑠 say, resulting from summing out several of the ordered variables. This is now a doubly ordered (𝑠+2)-way table. The degrees of freedom for 𝑋2𝑈1⋯𝑈𝑟𝑍1⋯𝑍𝑠 are (𝐼1−1)(𝐼2−1)⋯(𝐼𝑟−1)(𝐼𝑟+1×𝐼𝑟+2×⋯×𝐼𝑚−1). There are 𝐼𝑟+1×𝐼𝑟+2×⋯×𝐼𝑚 multinomials (corresponding to 𝑍1=𝑧1,…,𝑍𝑠=𝑧𝑠) each with (𝐼1−1)(𝐼2−1)⋯(𝐼𝑟−1) degrees of freedom. However, one of these multinomials is determined by the marginals and the other multinomial models.

We decline to write out the contrasts corresponding to the asymptotically mutually independent standard normal variables that are linear combinations of the 𝑍𝑤1⋯𝑤𝑟𝑧1⋯𝑧𝑠. The approach is similar to that employed in Section 3.