0

I am performing an analysis and am using marginal homogeneity/stuart maxwell for the first time. It is a pre-post test and in analyzing secondary outcomes I ran into an issue. I downloaded three different marginal homogeneity packages in R ("DescTools", "irr", and "coin" with the commands "StuartMaxwellTest()", "stuart.maxwell.mh()", and "mh_test()". For all of my outcomes, these three packages all agree except for one.

Here is the table I am analyzing:

> Emo
 1  2  3  4

1 1 0 0 0 2 0 4 5 0 3 0 0 23 6 4 0 0 1 12

The issue is the first row/column.

Here are the test results:

> StuartMaxwellTest(Emo)
Stuart-Maxwell test

data: Emo chi-squared = 8.5714, df = 3, p-value = 0.03557

> stuart.maxwell.mh(Emo)
Error in solve.default(smS) : 
  Lapack routine dgesv: system is exactly singular: U[1,1] = 0
> mh_test(Emo)

    Asymptotic Marginal Homogeneity Test

data:  response by conditions (Var1, Var2) 
     stratified by block
chi-squared = 8.5714, df = 2, p-value = 0.01376

Warning message:
In .local(.Object, ...) :
  The conditional covariance matrix has zero diagonal elements

To recap: the first package analyzes it normally. The second package does not complete the test. The third package, I think, ignores the first column/row and treats it as a 3x3 table *hence the df = 2.

Does anyone have any insight into which test result I should use? I am leaning towards the first as it seems the most conservative but I am not sure.

0 Answers0