repeated measures anova for three dimensional matrix using several for loops

6 ビュー (過去 30 日間)
Kim Arnold
Kim Arnold 2020 年 2 月 10 日
Dear all, im trying to run a ranova test on my samples
I have in total 15 Samples/ Matrices with dimensions of 18x5038 each. the 18 rows are always several timepoints and the 5038 are feature intensities at that particular timepoints. I have to do 3 loops in total; i have to loop over my samples(15) , over timepoints (18) and over features (5038). Consider that in the t_Strains table i want to have the time points in columns as the time points in the orginial matrices are in rows. in the end i want to compute the two LB p-values as i wrote in the code already.
I would really appreciate your help.
Strains = ['B' 'B' 'B' 'J' 'J' 'J' 'T' 'T' 'T'...
'C' 'C' 'C' 'D' 'D' 'D']';
FinalpVal = zeros(2,length(Spos.FeatFilter));
for i=1:length(Spos.FeatFilter) %loop over features
for j=1:length(FieldNames) %loop over samples
for k=1:length(Spos.Submatrices.tpoints) %loop over timepoints
t_Strains(i) = table(Strains,(here i need the input from the 15 matrices of my samples)
'VariableNames',{'Strains','t0', 't0.1', 't0.25', 't0.5', 't1', 't2', 't3', 't4', 't5', 't6', 't7',...
't8', 't9', 't10', 't11', 't12', 't13', 't14'});
rm_Strains = fitrm(t_Strains,'t0-t14 ~ Strains','WithinDesign',bact_tp);
ranovatbl_Strains=ranova(rm_Strains);
FinalpVal(:,i) = table2array(ranovatbl_Strains(1:2,8));
end
end
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeANOVA についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by