I have the following data:
data = {'treatment_1': [80, 0, 0, 8],
'treatment_2': [78, 62],
'treatment_3': [85, 62, 10, 3, 18, 18, 98, 71, 78, 12, 52, 39, 24, 13],
'treatment_4': [78, 33, 78, 40, 47, 32]
}
I am trying to run an ANOVA comparing these four treatments. As you can see, there are different numbers of data points in each treatment. Now, this shouldn't be a problem in theory, because ANOVA does not assume equal sample sizes. First, I tried to create a DataFrame. The code:
import pandas as pd
df = pd.DataFrame(data)
Gives me the error message:
ValueError: All arrays must be of the same length
So, this tells me that a DataFrame will not work. But no matter how I search for "Anova with unequal sample sizes," all I find is information using lists (and their code does not work with dictionaries) and/or equal sample sizes (which do not explain how to adjust for unequal sample sizes). How should I approach an ANOVA with dictionaries of different lengths? Or maybe I'm going about this wrong using dictionaries in the first place?