Filter löschen
Filter löschen

Irreproducibility of anovan on Mac vs. PC implementations of MATLAB

3 Ansichten (letzte 30 Tage)
Kevin Janes
Kevin Janes am 29 Aug. 2023
Kommentiert: Kevin Janes am 5 Jan. 2024
We are experiencing issues with a basic implementation of anovan yielding different F statistics when the same code is run on different computers. The biggest difference is between Mac and PCs, but there are also differences among multiple laptops of the same type. If we load the following dataset (Testdata.mat) and then attempt to call anovan as follows, we get a different answer on a Mac:
compared to what we obtain on a PC (below). The problem persists when we remove nesting, change computers, etc. Note that the sum-of-squares and mean-squared estimates are identical, but the F statistics diverge indicating differences in how the degrees of freedom are calculated. We appreciate any guidance on this matter.
load Testdata
anovan(data,grouplabels,'continuous',1,'random',3, ...
'varnames',{'Day' 'Volume' 'Replicate'},'model','interaction', ...
'nested',[0 0 0; 0 0 1; 0 0 0]);
  4 Kommentare
dpb
dpb am 29 Aug. 2023
Realistically, that probably will take a TMW bug/support request to get to the bottom of, then.
There is at least one other regular here who has Mac who may see this and may be inclined to delve deeper, but I don't know that he has the wherewithal to generate/compare the result on the Windows side.
I simply don't have time to dig much deeper at the moment, sorry...
Kevin Janes
Kevin Janes am 29 Aug. 2023
Bug support request just submitted, thanks.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shivansh
Shivansh am 5 Jan. 2024
Hi Kevin!
I understand that you are getting different results for F statistics when the same code is run on different computers. The difference is maximum when calculated on “Mac than other PCs.
I have faced a similar issue and found a possible workaround to resolve it. Please follow the below the steps which involves editing the “anovan.m” file in Matlab to resolve the issue,
  • Open MATLAB and run the following command in the command window.
edit anovan.m
  • Copy the entire code content into a new file "anovan_temp.m"
  • Modify line 680 as shown below
tol = 100 * max(size(R)) * eps(R(1,1)); % before
tol = 100 * max(size(adjx1)) * eps(R(1,1)); % after
  • Save the file in any directory.
  • Navigate to the path of the original "anovan.m" file in File Explorer
  • E.g 'C:\Program Files\MATLAB\R2023a\toolbox\stats\stats'
  • Rename the "anovan.m" file to "anovan_old.m"
  • Paste the "anovan_temp.m" file in the same directory as "anovan_old.m"
  • Rename "anovan_temp.m" to "anovan.m".
  • Restart MATLAB and run the command for "anovan".
You can refer to the following link to get more information on “anovan”: https://in.mathworks.com/help/stats/anovan.html.
Hope it helps!

Kategorien

Mehr zu Adding custom doc finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by