You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: helper function is_nested, support for nested categorical #5722
We don't have any explicit support for nested categoricals,
patsy does something but I never looked closely and it looked like just data handling without handling implications for identifiability
We have one or several issues with an example where nested dummies caused problems. (which issue?)
related #5364 score test and similar with collinear columns
e.g. when we are binning to create bin or group dummies we need to check the rank or check for collinearity.
Aside:
I tried out nested categorical in two-way anova recently and patsy looks a bit fragile. (topic ICC with raters nested in main categorical).
I did not try out formulaic for it.
(Two-way nested anova is a pain.
Because of the nested pattern, the anova is not balanced, and therefore the split in different effects depends on the encoding. Changing which interaction terms are included, or which redundant columns are dropped, changes the results of the hypothesis tests. I did not see how we could test whether the main categorical (species) has an effect when the nested effect (workers) is present. I never read the literature on nested effects.)
Activity
josef-pkt commentedon Nov 17, 2025
update:
the module with the isnested helper function has been deleted.
However, it checks the formula and does not use linear algebra or similar, so it's not generally useful
https://github.com/statsmodels/statsmodels/blob/v0.4.0/statsmodels/sandbox/formula.py#L652
Aside:
I tried out nested categorical in two-way anova recently and patsy looks a bit fragile. (topic ICC with raters nested in main categorical).
I did not try out formulaic for it.
(Two-way nested anova is a pain.
Because of the nested pattern, the anova is not balanced, and therefore the split in different effects depends on the encoding. Changing which interaction terms are included, or which redundant columns are dropped, changes the results of the hypothesis tests. I did not see how we could test whether the main categorical (species) has an effect when the nested effect (workers) is present. I never read the literature on nested effects.)