Statistics, Machine Learning, Data Science, Financial Planning, Python.
['X', 'Y', 'X', 'Y', 'X', 'X', 'Y', 'X', 'Y', 'X', 'X', 'Y', 'X', 'Y', 'X'] } df = pd.DataFrame(data) df.head() y factor1 factor2 0 23 A X 1 25 A Y 2 28 B X 3 30 B Y 4 32 C X import statsmodels.api as sm from statsmodels.formula.api import ols # Fit the factorial ANOVA model model = ols('y ~