필터 지우기
필터 지우기

Anova-N output question

조회 수: 52 (최근 30일)
Nicholas Scott
Nicholas Scott 2024년 8월 6일 18:46
댓글: Divyam 2024년 8월 12일 3:59
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

채택된 답변

Divyam
Divyam 2024년 8월 8일 7:02
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
Nicholas Scott
Nicholas Scott 2024년 8월 9일 15:55
Thank you Divyam, I had actually started to ponder this question as to why the Line and pathology were tightly correlated and realized exactly where I went wrong with making this an anova3 way (at least with that categorization), so I change it to a different categorization to make more logical sense as to what might be helpful to deducing the behavior, trends, and interactions between variables. Thank you SO much!
Divyam
Divyam 2024년 8월 12일 3:59
You are welcome @Nicholas Scott, all the best for your work!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 ANOVA에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by