ehrapy.tools.test_nested_f_statistic

ehrapy.tools.test_nested_f_statistic(small_model, big_model)[source]

Calculate the P value indicating if a larger GLM, encompassing a smaller GLM’s parameters, adds explanatory power.

See https://stackoverflow.com/questions/27328623/anova-test-for-glm-in-python/60769343#60769343

Parameters:
  • small_model (GLMResultsWrapper) – fitted generalized linear models.

  • big_model (GLMResultsWrapper) – fitted generalized linear models.

Returns:

p_value of Anova test.

Return type:

float