
Anova-N output question
2 次查看(过去 30 天)
显示 更早的评论
Hello community!
The closest prompt I could find that is similar to this would be: https://www.mathworks.com/matlabcentral/answers/1876737-anova-n-outputs-as-not-full-rank-returns-nan-p-value?s_tid=sug_su , but the reason their's showed NaN was there was not enough values. For mine I have 5.4 thousand entries, so I'm not sure that is the problem.
To reduce clutter of the code, I am going to attach the .mat files and the one-line of code.
pTHalf = anovan(stats(:,1), {Patho CellLine MW},'model','interaction','varnames', ...
{'Pathology','Cell Line','Molecular Weights'});
I ensured the data is of the same types allowed within the format of the Anova-n overview page. The only thing that I could think of was that there are more than two groups within the Cell Line and Molecular Weights groupings, but the only one that worked was the molecular weights, so I also doubt that is the reason.
This is the output below. Why do I have missing sections associated with a 'not full rank'. I do not see anything on the anova-N page that discusses this.
Thanks community!
Nick

0 个评论
采纳的回答
Divyam
2024-8-8
Hi @Nicholas Scott, it appears that the terms 'Pathology' and 'Cell Line' are highly correlated. In such scenarios, removing one of them should not affect the model. The solve this problem, simply remove the term with lower contribution.
To figure out which terms are contributing more, change the 'sstype' of your 'anovan' function to '1'. This will calculate each term's contribution by adding that term to the terms already included before it. For more information about the 'sstype' refer to the following documentation link: https://www.mathworks.com/help/stats/anovan.html#:~:text=single%20%7C%20double-,sstype,-%E2%80%94%20Type%20of
% To determine the effect of adding Cell Line
pTHalf = anovan(stats(:,1), {Patho CellLine MW},'model','interaction','varnames', ...
{'Pathology','Cell Line','Molecular Weights'}, 'sstype',1);
% To determine the effect of adding Pathology
pTHalf = anovan(stats(:,1), {CellLine Patho MW},'model','interaction','varnames', ...
{'Cell Line','Pathology','Molecular Weights'}, 'sstype',1);
Upon running the above code, it is observed that the 'Pathology' term is not a full rank term, and its F value is far lower than the 'Cell Line' term. Hence removing the 'Pathology' term from the 'anovan' function should remove the issue.
pTHalf = anovan(stats(:,1), {CellLine MW},'model','interaction','varnames', ...
{'Cell Line','Molecular Weights'}, 'sstype',1);

In the above results you can observe that the terms are full ranked and there are no non-full rank terms.
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!