# Marginal Homogeneity test / Stuart-Maxwell test - overview

This page offers structured overviews of one or more selected methods. Add additional methods for comparisons (max. of 3) by clicking on the dropdown button in the right-hand column. To practice with a specific method click the button at the bottom row of the table

Marginal Homogeneity test / Stuart-Maxwell test | Marginal Homogeneity test / Stuart-Maxwell test | Logistic regression |
You cannot compare more than 3 methods |
---|---|---|---|

Independent variable | Independent variable | Independent variables | |

2 paired groups | 2 paired groups | One or more quantitative of interval or ratio level and/or one or more categorical with independent groups, transformed into code variables | |

Dependent variable | Dependent variable | Dependent variable | |

One categorical with $J$ independent groups ($J \geqslant 2$) | One categorical with $J$ independent groups ($J \geqslant 2$) | One categorical with 2 independent groups | |

Null hypothesis | Null hypothesis | Null hypothesis | |

H_{0}: for each category $j$ of the dependent variable, $\pi_j$ for the first paired group = $\pi_j$ for the second paired group.
Here $\pi_j$ is the population proportion in category $j.$ | H_{0}: for each category $j$ of the dependent variable, $\pi_j$ for the first paired group = $\pi_j$ for the second paired group.
Here $\pi_j$ is the population proportion in category $j.$ | Model chi-squared test for the complete regression model:
- H
_{0}: $\beta_1 = \beta_2 = \ldots = \beta_K = 0$
- H
_{0}: $\beta_k = 0$ or in terms of odds ratio: - H
_{0}: $e^{\beta_k} = 1$
- H
_{0}: $\beta_k = 0$ or in terms of odds ratio: - H
_{0}: $e^{\beta_k} = 1$
| |

Alternative hypothesis | Alternative hypothesis | Alternative hypothesis | |

H_{1}: for some categories of the dependent variable, $\pi_j$ for the first paired group $\neq$ $\pi_j$ for the second paired group. | H_{1}: for some categories of the dependent variable, $\pi_j$ for the first paired group $\neq$ $\pi_j$ for the second paired group. | Model chi-squared test for the complete regression model:
- H
_{1}: not all population regression coefficients are 0
- H
_{1}: $\beta_k \neq 0$ or in terms of odds ratio: - H
_{1}: $e^{\beta_k} \neq 1$ If defined as Wald $ = \dfrac{b_k}{SE_{b_k}}$ (see 'Test statistic'), also one sided alternatives can be tested: - H
_{1}right sided: $\beta_k > 0$ - H
_{1}left sided: $\beta_k < 0$
- H
_{1}: $\beta_k \neq 0$ or in terms of odds ratio: - H
_{1}: $e^{\beta_k} \neq 1$
| |

Assumptions | Assumptions | Assumptions | |

- Sample of pairs is a simple random sample from the population of pairs. That is, pairs are independent of one another
| - Sample of pairs is a simple random sample from the population of pairs. That is, pairs are independent of one another
| - In the population, the relationship between the independent variables and the log odds $\ln (\frac{\pi_{y=1}}{1 - \pi_{y=1}})$ is linear
- The residuals are independent of one another
- Variables are measured without error
- Multicollinearity
- Outliers
| |

Test statistic | Test statistic | Test statistic | |

Computing the test statistic is a bit complicated and involves matrix algebra. Unless you are following a technical course, you probably won't need to calculate it by hand. | Computing the test statistic is a bit complicated and involves matrix algebra. Unless you are following a technical course, you probably won't need to calculate it by hand. | Model chi-squared test for the complete regression model:
- $X^2 = D_{null} - D_K = \mbox{null deviance} - \mbox{model deviance} $
$D_{null}$, the null deviance, is conceptually similar to the total variance of the dependent variable in OLS regression analysis. $D_K$, the model deviance, is conceptually similar to the residual variance in OLS regression analysis.
The wald statistic can be defined in two ways: - Wald $ = \dfrac{b_k^2}{SE^2_{b_k}}$
- Wald $ = \dfrac{b_k}{SE_{b_k}}$
Likelihood ratio chi-squared test for individual $\beta_k$: - $X^2 = D_{K-1} - D_K$
$D_{K-1}$ is the model deviance, where independent variable $k$ is excluded from the model. $D_{K}$ is the model deviance, where independent variable $k$ is included in the model.
| |

Sampling distribution of the test statistic if H_{0} were true | Sampling distribution of the test statistic if H_{0} were true | Sampling distribution of $X^2$ and of the Wald statistic if H_{0} were true | |

Approximately the chi-squared distribution with $J - 1$ degrees of freedom | Approximately the chi-squared distribution with $J - 1$ degrees of freedom | Sampling distribution of $X^2$, as computed in the model chi-squared test for the complete model:
- chi-squared distribution with $K$ (number of independent variables) degrees of freedom
- If defined as Wald $ = \dfrac{b_k^2}{SE^2_{b_k}}$: approximately the chi-squared distribution with 1 degree of freedom
- If defined as Wald $ = \dfrac{b_k}{SE_{b_k}}$: approximately the standard normal distribution
- chi-squared distribution with 1 degree of freedom
| |

Significant? | Significant? | Significant? | |

If we denote the test statistic as $X^2$:
- Check if $X^2$ observed in sample is equal to or larger than critical value $X^{2*}$ or
- Find $p$ value corresponding to observed $X^2$ and check if it is equal to or smaller than $\alpha$
| If we denote the test statistic as $X^2$:
- Check if $X^2$ observed in sample is equal to or larger than critical value $X^{2*}$ or
- Find $p$ value corresponding to observed $X^2$ and check if it is equal to or smaller than $\alpha$
| For the model chi-squared test for the complete regression model and likelihood ratio chi-squared test for individual $\beta_k$:
- Check if $X^2$ observed in sample is equal to or larger than critical value $X^{2*}$ or
- Find $p$ value corresponding to observed $X^2$ and check if it is equal to or smaller than $\alpha$
- If defined as Wald $ = \dfrac{b_k^2}{SE^2_{b_k}}$: same procedure as for the chi-squared tests. Wald can be interpret as $X^2$
- If defined as Wald $ = \dfrac{b_k}{SE_{b_k}}$: same procedure as for any $z$ test. Wald can be interpreted as $z$.
| |

n.a. | n.a. | Wald-type approximate $C\%$ confidence interval for $\beta_k$ | |

- | - | $b_k \pm z^* \times SE_{b_k}$ where the critical value $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval). | |

n.a. | n.a. | Goodness of fit measure $R^2_L$ | |

- | - | $R^2_L = \dfrac{D_{null} - D_K}{D_{null}}$ There are several other goodness of fit measures in logistic regression. In logistic regression, there is no single agreed upon measure of goodness of fit. | |

Example context | Example context | Example context | |

Subjects are asked to taste three different types of mayonnaise, and to indicate which of the three types of mayonnaise they like best. They then have to drink a glass of beer, and taste and rate the three types of mayonnaise again. Does drinking a beer change which type of mayonnaise people like best? | Subjects are asked to taste three different types of mayonnaise, and to indicate which of the three types of mayonnaise they like best. They then have to drink a glass of beer, and taste and rate the three types of mayonnaise again. Does drinking a beer change which type of mayonnaise people like best? | Can body mass index, stress level, and gender predict whether people get diagnosed with diabetes? | |

SPSS | SPSS | SPSS | |

Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples...
- Put the two paired variables in the boxes below Variable 1 and Variable 2
- Under Test Type, select the Marginal Homogeneity test
| Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples...
- Put the two paired variables in the boxes below Variable 1 and Variable 2
- Under Test Type, select the Marginal Homogeneity test
| Analyze > Regression > Binary Logistic...
- Put your dependent variable in the box below Dependent and your independent (predictor) variables in the box below Covariate(s)
| |

n.a. | n.a. | Jamovi | |

- | - | Regression > 2 Outcomes - Binomial
- Put your dependent variable in the box below Dependent Variable and your independent variables of interval/ratio level in the box below Covariates
- If you also have code (dummy) variables as independent variables, you can put these in the box below Covariates as well
- Instead of transforming your categorical independent variable(s) into code variables, you can also put the untransformed categorical independent variables in the box below Factors. Jamovi will then make the code variables for you 'behind the scenes'
| |

Practice questions | Practice questions | Practice questions | |