Click here to Skip to main content
15,902,922 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all,

I have two questions:

1) I would like to create a function and combining it with a for loop to do an ANOVA on a hundred of columns. I've imported a xlsx file from excel and I'm using pandas.
My dataset has an "Age column" that is my indipendent variable, and a hundred of columns of biological values that are my dependent variables.
The anova formula is ( with the first columns of biovariable "MEt1_1)


2)The second question is: how can I put the anova results into a boxplot like this:



I'm relatively new to python and I'm trying to learn as fast as i can, thanks in advance for all the help!

What I have tried:

`mod = ols('Met1_1 ~ Age ', data=Analisi).fit()
aov_table = sm.stats.anova_lm(mod, typ=2)
print(aov_table)`

`sns.boxplot(x="AgeT1", y="Met1_1",hue="Gender", palette=["m", "g"],data=AnalisiISAD)
sns.set(style="ticks", palette="pastel", rc={'figure.figsize':(25,20)})
sns.despine(offset=10, trim=True)`
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900