
That's not a problem when you treat them as numeric, but it is when you try to estimate all coefficients including the interaction in a factorial design. You have no cases for which Var1=1 and Var2=3. I copied your data into an R data frame, set those to factors, and got the following: ftable(anov1 $Var1,anov1$Var2)
Matlab vs python online software#
I suspect that the problem comes from how the software deals with the missing combination of Var1 and Var2 when they are treated as factors. Just trying another Python module: pingouin. Seeing all of the above, which results should I be using? Can I trust anovan? How do I reconcile the differences between anovan and the other methods? None of the methods give the same result as the anovan Matlab function, which is specifically meant to do an N-way ANOVA on an unbalanced design.


Lm = fitlm(t2, 'Result ~ Var1 + Var2 + Var1:Var2')
Matlab vs python online code#
Now, Var1 and Var2 are technically categorical/ordinal variables, so I changed the above code to specify that: t2 = t This gave me the following results: SumSq DF MeanSq F pValue Next, I decided to basically do the same thing, but using the fitlm function in Matlab: lm = fitlm(t, 'Result ~ Var1 + Var2 + Var1:Var2') I ran my code like so: t = readtable('data_file.xlsx') Now, I normally use Matlab for my stats, so I use the anovan function which can handle unbalanced designs ( ).
