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?)
statsmodelsfunction to calculate the scale for a fitted model and check if scale=1. – Dave Apr 01 '20 at 22:33statsmodels.genmod.generalized_linear_model.GLMdoes QMLE, which is not valid for such cases. I am not sure where that happens, as I have gottenstatsmodelslogistic regressions to give me the same results as logistic regression in R, and a post on SO may be warranted, butstatsmodelsdidn't break statistics with the quote I found. Phew! – Dave Apr 02 '20 at 00:50statsmodelsdefault to scale=1 for a "usual" logistic regression? – Dave Apr 02 '20 at 01:19scaleis also an attribute of the results instance that you can check to verify – Josef Apr 02 '20 at 01:51