I am working on translating some R code into Python's statsmodels
package, chiefly some logistic regression work that I've done, when I came across the following in the statsmodels
documentation,
WARNING: Loglikelihood and deviance are not valid in models where scale is equal to 1 (i.e., Binomial, NegativeBinomial, and Poisson). If variance weights are specified, then results such as loglike and deviance are based on a quasi-likelihood interpretation. The loglikelihood is not correctly specified in this case, and statistics based on it, such AIC or likelihood ratio tests, are not appropriate.
What is this "scale", and what is the statistical reason why scale=1 invalidates the likelihood ratio test that I want to use and have used in R? (Was it even valid when I did it in R?)
statsmodels
function to calculate the scale for a fitted model and check if scale=1. $\endgroup$statsmodels.genmod.generalized_linear_model.GLM
does QMLE, which is not valid for such cases. I am not sure where that happens, as I have gottenstatsmodels
logistic regressions to give me the same results as logistic regression in R, and a post on SO may be warranted, butstatsmodels
didn't break statistics with the quote I found. Phew! $\endgroup$