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
fromstatsmodels.stats.anovaimportanova_lmimportstatsmodels.formula.apiassmimportpandasaspdcps=pd.read_csv("http://www.mosaic-web.org/go/datasets/cps.csv")
mod1=sm.ols("wage ~ married + age + educ", data=cps)
fit1=mod1.fit()
anova_lm(fit1, typ=1)
which is working beautifully. However, I'd like to compare this with married (which is a categorical variable) coming in last in the ANOVA test. I had thought that this would do the trick:
however, patsy always puts the categorical variables first in the design matrix.
Based on a conversation on the mailing list, it looks like the most viable option to control order is to add an order argument to anova_lm (and its 'sub-fuctions').
Activity
josef-pkt commentedon Apr 3, 2018
I guess this has never been addressed, and I just found it while searching for type 2.
Needs checking for 0.10, I'm not familiar enough with the implementation details
josef-pkt commentedon Nov 9, 2022
I just found this again searching for anova types
maybe for 0.15