fffrost
2018-09-26 19:41:54 UTC
Hello, how can I obtain sum of squares when using AnovaRM? In this example
there is no output that shows the sum sq, but I would like to be able to
calculate effect size.
from statsmodels.stats.anova import AnovaRM
import pandas as pd
# import dataset and try factorial
df = pd.read_csv('C://Users//L//Desktop//factorial_data.csv')
df
subject time_of_day difficulty RT
0 1 1 1 155
1 1 1 2 215
2 1 2 1 222
3 1 2 2 261
4 2 1 1 167
5 2 1 2 224
6 2 2 1 214
7 2 2 2 265
8 3 1 1 196
9 3 1 2 223
10 3 2 1 219
11 3 2 2 258
12 4 1 1 172
13 4 1 2 216
14 4 2 1 179
15 4 2 2 270
16 5 1 1 195
17 5 1 2 219
18 5 2 1 191
19 5 2 2 272
aovrm2 = AnovaRM(df, 'RT', 'subject', within=['difficulty', 'time_of_day'])
fit = aovrm2.fit()
fit.summary()
Out[10]:
<class 'statsmodels.iolib.summary2.Summary'>
"""
Anova
===================================================
Num DF Den DF F Value Pr > F
---------------------------------------------------
difficulty 1.0000 4.0000 86.3840 0.0007
time_of_day 1.0000 4.0000 39.3700 0.0033
difficulty:time_of_day 1.0000 4.0000 1.4098 0.3008
===================================================
"""
Thanks
there is no output that shows the sum sq, but I would like to be able to
calculate effect size.
from statsmodels.stats.anova import AnovaRM
import pandas as pd
# import dataset and try factorial
df = pd.read_csv('C://Users//L//Desktop//factorial_data.csv')
df
subject time_of_day difficulty RT
0 1 1 1 155
1 1 1 2 215
2 1 2 1 222
3 1 2 2 261
4 2 1 1 167
5 2 1 2 224
6 2 2 1 214
7 2 2 2 265
8 3 1 1 196
9 3 1 2 223
10 3 2 1 219
11 3 2 2 258
12 4 1 1 172
13 4 1 2 216
14 4 2 1 179
15 4 2 2 270
16 5 1 1 195
17 5 1 2 219
18 5 2 1 191
19 5 2 2 272
aovrm2 = AnovaRM(df, 'RT', 'subject', within=['difficulty', 'time_of_day'])
fit = aovrm2.fit()
fit.summary()
Out[10]:
<class 'statsmodels.iolib.summary2.Summary'>
"""
Anova
===================================================
Num DF Den DF F Value Pr > F
---------------------------------------------------
difficulty 1.0000 4.0000 86.3840 0.0007
time_of_day 1.0000 4.0000 39.3700 0.0033
difficulty:time_of_day 1.0000 4.0000 1.4098 0.3008
===================================================
"""
Thanks