# -*- coding: utf-8 -*-
"""
Created on Wed Jan  5 17:03:15 2022

@author: Sim
"""
import pandas as pd
from statsmodels.formula.api import ols
import statsmodels.api as sm

high = [10.6, 11.7, 9.5, 9.3, 10.0, 6.9, 13.6, 7.5, 11.9, 5.6]
mid = [8.6, 11.0, 7.4, 9.2, 11.8, 10.3, 11.0, 7.8, 11.4, 14.6]
low = [10.0, 11.8, 8.6, 7.4, 10.0, 9.6, 13.3, 10.2, 10.8, 6.2]
dfw = pd.DataFrame({'high': high, 'mid':mid, 'low':low})

group = ['high']*len(high) + ['mid']*len(mid) + ['low']*len(low)
dfl = pd.DataFrame({'group': group, 'y': high+mid+low})
#----------------------------------------------------
res1 = ols('y~group', data=dfl).fit()
aov_table1 = sm.stats.anova_lm(res1, type=3)
print(aov_table1)
#------------------------------------------------------
dfw.boxplot(column=['high', 'mid','low'])
#------------------------------------------------------



 
