stepsel.stattests.likelihood_ratio_test
Likelihood ratio test for nested models.
References # https://api.rpubs.com/tomanderson_34/lrt # https://towardsdatascience.com/the-likelihood-ratio-test-463455b34de9
Functions
|
Calculate likelihood ratio test for nested models. |
|
Calculate likelihood ratio test for nested models. |
Module Contents
- stepsel.stattests.likelihood_ratio_test.likelihood_ratio_test(llf_complex, llf_nested, df_complex, df_nested)[source]
Calculate likelihood ratio test for nested models.
- Parameters:
llf_complex (float) – Log-likelihood of complex model.
llf_nested (float) – Log-likelihood of nested model.
df_complex (int) – Degrees of freedom of complex model.
df_nested (int) – Degrees of freedom of nested model.
- Returns:
- lrfloat
Likelihood ratio test statistic.
- pfloat
p-value of likelihood ratio test.
- Return type:
tuple
- stepsel.stattests.likelihood_ratio_test.likelihood_ratio_test_models(complex: statsmodels.api.GLM, nested: statsmodels.api.GLM)[source]
Calculate likelihood ratio test for nested models.
- Parameters:
complex (sm.GLM) – Complex model.
nested (sm.GLM) – Nested model.
- Returns:
- lrfloat
Likelihood ratio test statistic.
- pfloat
p-value of likelihood ratio test.
- Return type:
tuple