I agree, most of us can learn programming.

]]>I tried to put in your function the “key of the interaction” (print(extract_for_apa((‘AGE’ , ‘ETHNICGROUP’ , ‘SEXP’), aov)) it doesn’t work. ]]>

print(extract_for_apa(‘AGE’, aov))

{‘p’: 0.38304275607253779, ‘mse’: 0.00071049005495488833, ‘eta’: 0.0047898426784019855, ‘F’: 0.77986179350784657}

print(extract_for_apa(‘ETHNICGROUP’, aov))

{‘p’: 0.019574151602473413, ‘mse’: 0.00069223374419013475, ‘eta’: 0.034659508263642044, ‘F’: 5.9711544610483269}

print(extract_for_apa(‘SEXP’, aov))

‘p’: 0.44921555871908303, ‘mse’: 0.00091254877064392932, ‘eta’: 0.0046182855882132079, ‘F’: 0.58533465964381803}

Due to my lack of knowledge in data analysis, I thought that if you want to explore the interaction between two wfactors and one bfactor you have to obtain just one p value (and not one for every variable.)…but as you said I was wrong!

]]>I am glad you found it helpful. I realize that I don’t show an example of how to use that function. It can extract the values for each factor:

`print(extract_for_apa('condition', aov))`

Would print F, MSE, eta-squared, and the p-value (based on the example above). In your case you could loop through the 3 variables of interest or just runt the function 3 times with your variables as input. Let me know if it doesn’t work or if you need help.

/Erik

]]>I am a beginner in Python, I’m trying to use your guide for running a split plot anova (my goal is to determine the interaction between two within variables( AGE’, ‘ETHNICGROUP’) and one between variable( ‘SEXP’). and I obtained the output (thank you again).

Now I’m trying to use your function to extract the p-value obtained with the anova method, but I don’t understand how it works.

These are my aov.keys():

[(‘AGE’,),

(‘ETHNICGROUP’,),

(‘AGE’, ‘ETHNICGROUP’),

(‘SEXP’,),

(‘AGE’, ‘SEXP’),

(‘ETHNICGROUP’, ‘SEXP’),

(‘AGE’, ‘ETHNICGROUP’, ‘SEXP’),

(‘SUBJECT’,),

(‘TOTAL’,),

(‘WITHIN’,),

(‘AGE’, ‘SUBJECT’),

(‘ETHNICGROUP’, ‘SUBJECT’),

(‘AGE’, ‘ETHNICGROUP’, ‘SUBJECT’)]

How do I modify your script? ==> def extract_for_apa(factor, aov, values = [‘F’, ‘mse’, ‘eta’, ‘p’]):

results = {}

for key,result in aov[(factor,)].iteritems():

if key in values:

results[key] = result

return results

]]>I believe in the first paragraph you mean to say you’ve previously covered ONE-way ANOVA rather than two-way when pointing to the previous article (https://www.marsja.se/four-ways-to-conduct-one-way-anovas-using-python/)? ]]>

Erik

]]>Thanks for your the article.

For your information, in spyder3 you can change the theme to dark

Best, ]]>