Repository navigation
ENH: Add use_t and Kauermann-Carroll covariance to GEE - #10781
Conversation
With use_t=True, inference uses the t distribution with the number of groups minus the number of parameters as degrees of freedom. Closes statsmodels#8610.
Add cov_type="kauermann_carroll", tested against R geesmv along with the existing bias_reduced option. xref statsmodels#1183.
|
Also because personally I am working with GGE a lot in my current project. Is it an option to add divide-and-conquer version GGE and does it make sense to cover more small-sample corrections, with t/F degrees of freedom, like, geesmv in R? |
|
Thanks for the PR. The Kauermann-Carroll covariance agrees with an independent implementation and with R
Nits:
Not needed here, but worth separate issues: On your question about more |
Explain in the docstring why the t df subtract the number of parameters.
|
Thank you for review @bashtage. Addressed your points in the code, and will raise separate for corrections and DC-GEE. |
|
LGTM. Thanks. |
DOC: Follow up #10781 on the use_t docstring of GEE
NumPy's guide.
Adds two small-sample options to GEE, for data with few clusters:
use_t:fit(use_t=True)uses the t distribution for p-values, confidence intervals,t_testandf_test, with degrees of freedom = number of groups minus number of parameters. Also works forOrdinalGEEandNominalGEE. The default is unchanged.cov_type="kauermann_carroll": the Kauermann-Carroll robust covariance. It is like"bias_reduced"(Mancl-DeRouen), but usesTests:
"kauermann_carroll"and the existing"bias_reduced"match Rgeesmv1.3 to about 1e-13. The R script, data and reference values are ingenmod/tests/results.scipy.linalg.sqrtm.mainand pass here.AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s):
Claude (Claude Code).Used for:
drafting the tests, running the R scripts.I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.