VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Mathematics? | Stuart–Maxwell, Marginal Homogeneity and Paired Category Flows

Three students work together at a classroom table, reviewing open textbooks and notes.

Why is mathematics important when the same people move between categories? Because unchanged category totals do not mean unchanged individuals. The Stuart–Maxwell test examines marginal homogeneity in a paired square table: whether the population proportions in the categories are the same at the two measurements. It preserves pairing while focusing on the balance of category membership rather than exact agreement or every direction of movement.

Imagine the same synthetic group classified into three states before and after an event. Some units move upward, some downward and some remain in place. The overall proportions might barely change even when many units move. Mathematics separates those two descriptions, allowing a reader to ask whether the practical concern is population composition, individual stability or a particular transition.

This guide explains the row and column margins, the covariance of their differences, a checked three-category example and important distinctions from Bowker’s symmetry test. Every dataset is invented for learning. The article does not assess a real school, programme or intervention, and no causal effect follows merely from having before-and-after observations.

Did You Know? A population can cycle completely through three categories while retaining exactly the same marginal distribution. A test of marginal homogeneity is designed to recognise that unchanged composition, not to certify that nobody moved.

Full chapter index

Chapters 1–6 · Understand the question
  1. Define the paired observational unit
  2. Read a square table as flows
  3. State marginal homogeneity precisely
  4. Why the margin differences are dependent
  5. Build the count-based covariance matrix
  6. Remove one redundant category
Chapters 7–10 · Reproduce the example
  1. Worked example: seventy paired classifications
  2. Interpret the large p-value carefully
  3. Compare with Bowker symmetry on the same table
  4. A complete cycle preserves margins
Chapters 11–19 · Check assumptions
  1. The two-category case connects with McNemar
  2. Diagonal agreement answers another question
  3. More stable units do not create directional imbalance
  4. Singular covariance is a diagnostic signal
  5. Zero-cell settings are not neutral
  6. Category definitions must remain stable
  7. Attrition can change the paired population
  8. Independence between units still matters
  9. Before-and-after is not automatically causal
Chapters 20–21 · Explore applications
  1. A three-state system investigation
  2. A school-progress interpretation exercise
Chapters 22–25 · Study and verify
  1. Learn through balances and matrices
  2. Practice questions with checking answers
  3. Frequently asked questions
  4. Sources and next reading

CHAPTER 1 OF 25 · Understand the question

1. Define the paired observational unit

Back to contents

Each unit supplies two categorical measurements using the same category system. Rows can represent the first measurement and columns the second. The cell n_ij counts units beginning in category i and ending in category j.

The observations within a unit are intentionally dependent: that pairing is the reason to use a square transition table. Different units are assumed independent in the simple sampling analysis. Repeated pairs from the same person or units nested in shared clusters require additional design care.

The categories must have the same meanings at both measurements. A row category called emerging and a column category called emerging must use compatible criteria. Changing the rubric can create apparent movement without an underlying change in what is being measured.

Keep unit identities long enough to construct valid pairs, with appropriate privacy protection. Separate unpaired totals are insufficient to reconstruct transitions or the paired uncertainty structure. Once the matching information is lost, a square display cannot manufacture it afterwards.

Contents · Next chapter

CHAPTER 2 OF 25 · Understand the question

2. Read a square table as flows

Back to contents

Diagonal cells count units whose category did not change. Off-diagonal cells represent directed moves. A large diagonal describes substantial observed stability, but marginal balance depends on how incoming and outgoing movements compare.

The row total r_i is the number initially in category i. The column total c_i is the number finally in that category. Their difference d_i=r_i−c_i is a net change count under this sign convention.

A positive d_i means more units started than finished in category i. It does not count all departures because some incoming movements can offset them. Inspect the individual cells to understand the gross flows behind the net number.

This distinction between gross movement and net balance appears far beyond statistics, in inventories, population flows and resource systems. A stable stock can conceal substantial turnover. A paired table makes that hidden movement visible instead of treating equal totals as a complete story.

Contents · Previous chapter · Next chapter

CHAPTER 3 OF 25 · Understand the question

3. State marginal homogeneity precisely

Back to contents

The null says the population probability of category i at the first measurement equals that at the second, for every category. In notation, p_i+=p_+i. It does not require the full joint transition table to be symmetric or concentrated on the diagonal.

The alternative is that at least one marginal category proportion differs. This is an omnibus comparison. Rejection does not identify every category responsible or show that each type of movement has the same direction.

Categories need not be ordinal. The method can compare named states with no natural low-to-high order, provided they mean the same thing at both times. If an ordered improvement question is the target, that additional structure needs a separate analysis or descriptive contrast.

Write the intended claim before calculating. “The category proportions changed,” “many individuals changed” and “the change was beneficial” are different statements. A marginal-homogeneity result addresses only the first under its assumptions.

Contents · Previous chapter · Next chapter

CHAPTER 4 OF 25 · Understand the question

4. Why the margin differences are dependent

Back to contents

Every unit contributes once to a row and once to a column. If a unit moves from A to B, it decreases A’s final-minus-initial balance and increases B’s. Category difference counts therefore cannot vary independently.

The differences sum to zero because row and column grand totals are equal. With K categories, only K−1 margin differences are free. Keeping all K without accounting for that constraint creates a singular representation.

A naive collection of independent two-proportion tests would ignore both pairing and the shared balance constraint. It would also create a multiple-testing problem while failing to represent the covariance caused by movement between categories.

The Stuart–Maxwell construction uses a covariance matrix for the differences. The matrix records how movement connecting two categories links their net changes. This is the essential mathematical step, not a decorative addition to a calculation that could otherwise treat margins as unrelated samples.

Contents · Previous chapter · Next chapter

CHAPTER 5 OF 25 · Understand the question

5. Build the count-based covariance matrix

Back to contents

For category i, the diagonal entry is V_ii=r_i+c_i−2n_ii. Equivalently, it is the sum of all off-diagonal movements into or out of that category. Units staying in the category do not contribute to that transition variability term.

For different categories i and j, the entry is V_ij=−(n_ij+n_ji). Movement between i and j creates opposite changes in their net balances, hence the negative sign. The matrix is symmetric even when the transition table is not.

Use one consistent sign convention for the difference vector. Replacing d with −d leaves the quadratic statistic unchanged, but mixing signs category by category does not. Record whether differences are row-minus-column or column-minus-row.

The count formulation avoids unnecessary normalisation steps for hand calculations. A probability formulation divides by the total and then includes the corresponding sample-size factor. Both can agree when used consistently; mixing count and probability matrices changes the scale incorrectly.

Contents · Previous chapter · Next chapter

CHAPTER 6 OF 25 · Understand the question

6. Remove one redundant category

Back to contents

Choose K−1 categories and take their difference vector and corresponding covariance submatrix. In a regular informative table, solve Vz=d and calculate Q=dᵀz. This is equivalent to dᵀV⁻¹d without explicitly forming a numerical inverse.

The omitted category is not being discarded substantively. Its difference is determined by the others because all differences sum to zero. Under the regular formulation, the statistic should not depend on which category is omitted.

The usual reference is approximate chi-square with K−1 degrees of freedom. This requires appropriate large-sample conditions and a nondegenerate covariance structure. The number of printed categories alone does not guarantee those conditions.

For an implementation check, repeat the calculation with each possible omitted category on a well-behaved table. Agreement is a useful audit of the balance constraint and matrix construction. A discrepancy suggests a coding, indexing or numerical problem before it suggests a new scientific result.

Contents · Previous chapter · Next chapter

CHAPTER 7 OF 25 · Reproduce the example

7. Worked example: seventy paired classifications

Back to contents

Use the table [[20,8,1],[3,15,6],[5,2,10]]. Row totals are [29,24,17], column totals [28,25,17], and the grand total is seventy. The first-minus-second margin differences are [1,−1,0].

For the first two categories, the covariance submatrix is [[17,−11],[−11,19]]. The first diagonal is 29+28−40=17, the second is 24+25−30=19, and the off-diagonal is minus (8+3)=−11.

Its determinant is 17×19−11²=202. Applying the two-by-two inverse to d=[1,−1] gives Q=(19+17−22)/202=14/202=7/101≈0.06930693.

With two degrees of freedom, the approximate upper-tail probability is about 0.96594009. The arithmetic was independently checked with a direct linear solve and a probability-scaled formulation. The current statsmodels algorithm was inspected, but no execution of that package is claimed for this example.

Initial categoryFinal AFinal BFinal CRow total
A208129
B315624
C521017
Column totals28251770
Seventy paired classifications; rows are initial and columns final categories.

Contents · Previous chapter · Next chapter

CHAPTER 8 OF 25 · Reproduce the example

8. Interpret the large p-value carefully

Back to contents

The observed category totals are very similar at the two measurements. The Stuart–Maxwell statistic reflects that small net imbalance relative to the transition-based covariance. Under the stated approximation, the data do not reject marginal homogeneity.

This does not prove that the populations have identical marginal distributions. A non-rejection is limited by sample size, calibration and design. If practical equivalence is required, define tolerances on category-proportion changes and use an appropriate equivalence framework.

Nor does it show that individuals stayed in their original categories. The diagonal total is 20+15+10=45, so twenty-five of seventy units changed category in the synthetic table. That is substantial observed movement despite the nearly balanced margins.

Report both descriptions when they matter: marginal proportions address composition, while diagonal and off-diagonal summaries address stability and movement. A good explanation does not ask one p-value to replace all of those questions.

Contents · Previous chapter · Next chapter

CHAPTER 9 OF 25 · Reproduce the example

9. Compare with Bowker symmetry on the same table

Back to contents

Bowker’s null requires p_ij=p_ji for every mirrored off-diagonal pair. That is stronger than marginal homogeneity. Symmetric flows imply balanced margins, but balanced margins can arise through more complicated circulation.

For the worked table, Bowker’s statistic is 25/11+16/6+16/8≈6.93939394, with a nominal three-degree-of-freedom chi-square reference and approximate p≈0.07385479. Its question differs from the Stuart–Maxwell result near 0.966.

There is no contradiction. The methods examine different features of the same transition table. One asks whether each directional flow balances its reverse; the other asks whether all incoming and outgoing flows balance in aggregate at each category.

Do not choose whichever result supports a preferred narrative. Define the scientific target first and report distinct analyses as distinct questions when both are useful. Their shared square-table input does not make their hypotheses interchangeable.

Contents · Previous chapter · Next chapter

CHAPTER 10 OF 25 · Reproduce the example

10. A complete cycle preserves margins

Back to contents

Consider thirty units: ten move from A to B, ten from B to C, and ten from C to A. The table is [[0,10,0],[0,0,10],[10,0,0]]. Every unit changes category, but both row and column totals are [10,10,10].

The margin-difference vector is zero. In an informative covariance representation, the Stuart–Maxwell quadratic form is zero because there is no observed marginal imbalance. This is exactly the feature the method is designed to assess.

The table is not symmetric: A-to-B movement is not balanced by B-to-A movement, and similarly around the cycle. A symmetry comparison sees a very different pattern from a marginal comparison.

This example is useful in teaching because it removes ambiguity. “No marginal change” cannot mean “no individual change” when everyone visibly moves. Mathematics helps by giving each statement its own object and preventing a convenient summary from swallowing the rest of the evidence.

Contents · Previous chapter · Next chapter

CHAPTER 11 OF 25 · Check assumptions

11. The two-category case connects with McNemar

Back to contents

For a two-by-two paired table, only the discordant counts b and c determine the marginal difference. The uncorrected large-sample statistic reduces to (b−c)²/(b+c), the familiar McNemar chi-square expression when the denominator is positive.

An exact McNemar calculation uses a conditional binomial reference based on b+c and is a different calibration from the chi-square approximation. Continuity-corrected versions are additional explicit choices, not automatically the same numerical output.

If no discordant observations occur, the sample shows no category changes. That boundary needs an appropriate software convention or inferential treatment; it should not be interpreted by blindly dividing zero by zero.

The connection illustrates how a broader matrix method can contain a simpler special case. Students can verify the reduction by writing the one-element difference vector and covariance matrix, rather than accepting the relationship solely because two tests share a textbook chapter.

Contents · Previous chapter · Next chapter

CHAPTER 12 OF 25 · Check assumptions

12. Diagonal agreement answers another question

Back to contents

The diagonal proportion is the fraction of observed units whose category is unchanged. It is an intuitive stability summary, but it does not correct for category prevalence or establish agreement beyond a chosen chance model.

A high diagonal can coexist with a meaningful marginal shift if a small but consequential group changes in one direction. A low diagonal can coexist with balanced margins if opposing or cyclic movements cancel.

If agreement is the target, select an appropriate agreement analysis and describe its assumptions. If category-specific transitions matter, report those flows and uncertainty. Neither task is automatically completed by a marginal-homogeneity test.

For the worked example, forty-five stable units and twenty-five changing units are directly observed descriptive counts. The marginal p-value should be presented beside that movement picture, not used to erase it with the phrase “nothing changed.”

Contents · Previous chapter · Next chapter

CHAPTER 13 OF 25 · Check assumptions

13. More stable units do not create directional imbalance

Back to contents

Hold the off-diagonal counts fixed and add observations to diagonal cells. The row-minus-column differences do not change because each added diagonal unit increases the same row and column equally.

The count-based covariance entries also remain unchanged: diagonal additions cancel in r_i+c_i−2n_ii. Thus this particular Stuart–Maxwell statistic remains the same when only stable counts are added in that way.

This is a mathematical property of the paired contrast, not permission to ignore recruitment or sample composition. In a real study, new units might change the off-diagonal pattern as well. The thought experiment isolates one controlled modification so the formula can be understood.

It helps explain why the amount of discordant movement matters to this comparison. More rows in a dataset do not necessarily supply more information about directional transition imbalance if those rows contain no such contrast.

Contents · Previous chapter · Next chapter

CHAPTER 14 OF 25 · Check assumptions

14. Singular covariance is a diagnostic signal

Back to contents

Some categories may have no informative transitions, or the transition structure may make the reduced covariance singular. A linear solver can then fail because the nominal category contrasts are not all estimable from the observed pattern.

Do not automatically replace the inverse with a pseudoinverse and retain the original degrees of freedom without justification. A different effective rank can imply a different reference problem. The structural zeros and measurement design need inspection.

The maintained statsmodels implementation documents a warning and undefined result when its covariance matrix cannot be inverted. Such a warning should be retained in an analysis record rather than hidden behind a forced numeric result.

If categories need to be combined, justify the merger substantively and preserve the same mapping at both measurements. Merging solely to obtain significance changes the question. An informative failure is better than a clean number produced by an unacknowledged redesign.

Contents · Previous chapter · Next chapter

CHAPTER 15 OF 25 · Check assumptions

15. Zero-cell settings are not neutral

Back to contents

Some table-analysis constructors can modify zero cells through an optional correction. Check the exact implementation and its documented settings before reproducing a result. A correction intended for one analysis may change the counts used by another.

Preserve the original table and record whether any adjustments were applied. The worked seventy-unit example contains positive cells, so no zero-cell alteration is needed for its calculation. The cyclic example is descriptive and should not silently acquire artificial movements.

A zero observed transition does not prove that the corresponding population probability is zero. Conversely, a structural impossibility is not the same as a transition merely unobserved in a small sample. Those cases imply different models.

Keep design constraints separate from sampling zeros. A category system in which certain moves are impossible may require an analysis respecting those constraints rather than a generic full-table reference.

Contents · Previous chapter · Next chapter

CHAPTER 16 OF 25 · Check assumptions

16. Category definitions must remain stable

Back to contents

Before-and-after labels are comparable only when their meanings and classification rules remain compatible. A changed rubric, threshold or observer training can alter the table without the underlying units changing in the intended sense.

Document category definitions at both measurements. If rules changed, consider whether a defensible crosswalk exists and what information it loses. Do not treat a convenient label match as proof that the measurement systems are identical.

Ordered labels can also conceal different widths. A middle band might cover a narrow range before and a broad range after. Marginal differences could then reflect threshold changes rather than movement in the measured capability.

This is a useful connection with educational assessment. A claim about pupils moving between proficiency bands needs consistent standards as well as correct arithmetic. Statistical sophistication cannot repair a category system whose interpretation drifted unnoticed.

Contents · Previous chapter · Next chapter

CHAPTER 17 OF 25 · Check assumptions

17. Attrition can change the paired population

Back to contents

The square table normally contains units observed at both measurements. If some are missing at follow-up, the analysed paired set may differ from the original cohort. That selection can affect the observed marginal balance.

A missing category is not automatically the lowest category or evidence of no change. Reasons for missingness might include administrative error, withdrawal or a measurement that could not be performed. Keep those mechanisms visible.

Complete-pair analysis can be transparent, but its generalisation depends on how the retained units relate to the intended population. Sensitivity analysis or a model for missingness may be necessary in a substantive study.

For a classroom exercise, remove one synthetic transition and recompute the margins. Identify which category balances change and why. This links missing-data reasoning with the flow representation instead of treating exclusions as invisible spreadsheet cleaning.

Contents · Previous chapter · Next chapter

CHAPTER 18 OF 25 · Check assumptions

18. Independence between units still matters

Back to contents

Pairing handles dependence between the two observations from one unit. It does not automatically handle dependence between different units, such as pupils sharing a class or repeated classification pairs from one person.

If clusters are the sampling or assignment units, the analysis should preserve that structure. A large table of correlated records can appear more informative than the actual number of independent units supports.

For several measurement times, a collection of pairwise square tables reuses units and creates additional multiplicity and dependence. A longitudinal model may better represent the intended evolution across time.

Start the analysis record with the unit, sampling process and number of independent clusters where relevant. That information gives the covariance calculation a real-world referent. Without it, a mathematically correct table operation can still support an unjustified inferential claim.

Contents · Previous chapter · Next chapter

CHAPTER 19 OF 25 · Check assumptions

19. Before-and-after is not automatically causal

Back to contents

A marginal shift after an event can be associated with many influences: elapsed time, selection, measurement changes or other concurrent events. The Stuart–Maxwell test does not identify which explanation caused the observed difference.

A control group, randomisation or another justified causal design may provide additional information, but those features must be analysed appropriately. A paired table alone does not supply them simply because the same units appear twice.

Likewise, non-rejection does not establish that an intervention had no effect. Opposing individual changes can cancel in the margins, and limited information can obscure a genuine population difference.

Write a result about the measured marginal distributions, then separately discuss causal evidence and practical consequence. This keeps the method useful while preventing its p-value from becoming a verdict on every part of a programme.

Contents · Previous chapter · Next chapter

CHAPTER 20 OF 25 · Explore applications

20. A three-state system investigation

Back to contents

Create a synthetic system with categories ready, waiting and blocked. Specify thirty or more units with one initial and one final state. Build the transition table from records rather than beginning with a convenient set of margins.

Calculate row totals, column totals, net differences and gross movement. Construct one nearly balanced table with substantial turnover and another with little turnover but a directional imbalance. Explain why the two summaries tell different stories.

Then build the covariance matrix and verify the statistic using two omitted categories. Compare with symmetry and diagonal stability as separate questions. The goal is not to find the smallest p-value but to map each statistic to a precise system property.

End with a practical decision: does the organisation care about overall capacity composition, individual disruption or specific blocked-to-ready transitions? Different priorities require different evidence, even when they begin with the same table.

Contents · Previous chapter · Next chapter

CHAPTER 21 OF 25 · Explore applications

21. A school-progress interpretation exercise

Back to contents

Use synthetic learning bands with a stable rubric. Ask students to create a table where equal numbers move into and out of a band, then explain why its total stays constant. Follow the actual flows before calculating a test.

Avoid using group-level marginal balance to dismiss an individual learner’s progress or difficulties. A class distribution can remain stable while particular pupils make important gains and others need support. Individual work supplies information the aggregate margins do not contain.

For parents, the useful distinction is optimistic and practical: a group summary is one view, not the full learning story. Inspect the child’s explanations, errors and fresh independent attempts to decide the next step.

Mathematics supports that care by making the level of each claim explicit. The paired table describes movement, the margins describe composition, and a diagnostic conversation describes a learner’s understanding. They complement rather than replace one another.

Contents · Previous chapter · Next chapter

CHAPTER 22 OF 25 · Study and verify

22. Learn through balances and matrices

Back to contents

Begin with arrows between three categories and count incoming and outgoing moves. Show that net differences sum to zero. This provides a concrete route into the redundant-coordinate problem before matrix notation appears.

Next construct diagonal variability terms from all movements touching a category and negative off-diagonal terms from movements connecting two categories. The covariance structure then reflects visible flows rather than an unexplained formula.

Use the two-by-two reduced matrix in the worked example to practise determinants and linear equations. Reproduce 7/101 and check with an independent numerical solve. Keep the approximate reference distribution separate from the exact arithmetic.

Finally examine cyclic movement, sparse transitions and changed category definitions. A learner who can explain these boundary cases understands the purpose of the test more deeply than someone who can only submit a matrix to software.

Contents · Previous chapter · Next chapter

CHAPTER 23 OF 25 · Study and verify

23. Practice questions with checking answers

Back to contents

Question 1: If a unit moves from A to B, what happens to first-minus-second margin differences? A gains one and B loses one. Their total change is zero.

Question 2: Can every unit change while the margins stay identical? Yes. A balanced three-category cycle supplies a direct example. Marginal homogeneity does not mean individual stability.

Question 3: What is the first reduced diagonal in the worked example? It is 29+28−2×20=17. Count movements touching category A to verify the same result.

Question 4: What is the off-diagonal covariance entry for A and B? It is minus (8+3)=−11. The negative sign reflects opposite changes in their net balances.

Question 5: Does p≈0.966 prove equal population proportions? No. The approximate test did not reject. Equality, equivalence and individual stability are different claims requiring appropriate evidence.

Contents · Previous chapter · Next chapter

CHAPTER 24 OF 25 · Study and verify

24. Frequently asked questions

Back to contents

Must the categories be ordered?

No. The marginal-homogeneity question can use nominal categories, but the category system must be the same at both measurements. Ordered improvement is an additional question, not automatically the null being tested.

Is this the same as Bowker’s test?

No. Bowker compares mirrored directional transitions. Stuart–Maxwell compares row and column margins. Symmetry implies marginal homogeneity, but the reverse need not hold.

What happens with two categories?

The regular uncorrected chi-square calculation reduces to the McNemar expression. Exact and continuity-corrected calibrations remain explicit additional choices and can return different numerical probabilities.

Why might a covariance solve fail?

The observed transition structure may not support all nominal contrasts. Inspect structural zeros, uninformative categories and design constraints. Forcing a matrix inverse without revisiting the reference problem can produce misleading inference.

What belongs in the final report?

Include the paired table, category definitions, margins, movement summary, statistic, reference method and sampling limits. Separate population composition from individual stability and from any causal conclusion.

Contents · Previous chapter · Next chapter

CHAPTER 25 OF 25 · Study and verify

25. Sources and next reading

Back to contents

The maintained statsmodels homogeneity documentation specifies the marginal null and Stuart–Maxwell/Bhapkar options. Its public implementation was inspected alongside independent count-based and probability-based calculations. No local execution of statsmodels is claimed.

For the stronger paired-flow question, read Bowker symmetry. For two categories, continue with McNemar. The Mathematics Learning Hub connects these distinctions with probability, linear algebra and clear reasoning.

Contents · Previous chapter · Mathematics Learning Hub

Discover more from eduKate Singapore

Subscribe now to keep reading and get access to the full archive.

Continue reading