Unbalanced ANOVAN data preparation
조회 수: 2 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171954/image.jpeg)
Using this picture as an example, I have two histograms represented as lines (done using my own binning code). These histograms represent binning of pairwise correlations between genes. This graph is split into three correlation zones (Mid, High and Very High) for the two histograms. I extracted the all the pairwise correlations in each of these zones for the two histograms, giving me a total of 6 variables:
- Mid - N
- High - N
- Very High - N
- Mid - NTK
- High - NTK
- Very High - NTK
The length of each variable is different, hence it calls for an unbalanced ANOVA.
I'd like to run a two-way ANOVA to determine all possible interactions. If N and NTK are my two independent variables and correlations zones are independent, I believe I can phrase the problem in tabular form as:
Mid High Very High
N 6000 3000 1000
NTK 5000 4000 1500
The numbers represent the number of pairwise correlations in a group. So N - Mid has 6000 pairwise correlations stored in variable 'c1MiddleExport'. Question is, how does this go into MATLAB? I have tried the following
aData = vertcat(c1MiddleExport.Corr,c1HighExport.Corr,...
c1VeryHighExport.Corr,c2MiddleExport.Corr,c2HighExport.Corr,...
c2VeryHighExport.Corr);
g1 = repmat({'Mid-N'},[height(c1MiddleExport) 1]);
g2 = repmat({'High-N'},[height(c1HighExport) 1]);
g3 = repmat({'vHigh-N'},[height(c1VeryHighExport) 1]);
g4 = repmat({'Mid-NTK'},[height(c2MiddleExport) 1]);
g5 = repmat({'High-NTK'},[height(c2HighExport) 1]);
g6 = repmat({'vHigh-NTK'},[height(c2VeryHighExport) 1]);
g7 = repmat({'N'},[(height(c1MiddleExport)+height(c1HighExport)+...
height(c1VeryHighExport)) 1]);
g8 = repmat({'NTK'},[(height(c2MiddleExport)+height(c2HighExport)+...
height(c2VeryHighExport)) 1]);
corrGroups = vertcat(g1,g2,g3,g4,g5,g6);
condGroups = vertcat(g7,g8);
[p,table,stats,terms] = anovan(aData,{corrGroups condGroups},...
'model','interaction',...
'varnames',{'Correlation','Conditions'},...
'display','on');
Variable representation is as follows:
- c1MiddleExport --> Mid - N
- c1HighExport --> High - N
- c1VeryHighExport --> Very High - NTK
- c2MidExport --> Mid - NTK
- c2HighExport --> High - NTK
- c2VeryHighExport --> Very High - NTK
This however yields the following results:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171955/image.jpeg)
This is not what I am looking for and it seems wrong. I've tried this so many ways and I cannot for the life of me figure it out. I'd appreciate if someone could help me out here.
댓글 수: 0
답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!