RegressionResults.compare_lm_test(restricted, demean=True, use_lr=False)[source]

Use Lagrange Multiplier test to test a set of linear restrictions.

restrictedResult instance

The restricted model is assumed to be nested in the current model. The result instance of the restricted model is required to have two attributes, residual sum of squares, ssr, residual degrees of freedom, df_resid.


Flag indicating whether the demean the scores based on the residuals from the restricted model. If True, the covariance of the scores are used and the LM test is identical to the large sample version of the LR test.


A flag indicating whether to estimate the covariance of the model scores using the unrestricted model. Setting the to True improves the power of the test.


The test statistic which has a chi2 distributed.


The p-value of the test statistic.


The degrees of freedom of the restriction, i.e. difference in df between models.


The LM test examines whether the scores from the restricted model are 0. If the null is true, and the restrictions are valid, then the parameters of the restricted model should be close to the minimum of the sum of squared errors, and so the scores should be close to zero, on average.

Last update: Jul 16, 2024