Repeated measure with 2 between subject factors
1 次查看(过去 30 天)
显示 更早的评论
I have a mixed repeated measure data, how to fit it into the matlab data, and my code doesn't work,always error.
Data=[ PND28W0 PND64W6 PND82W9 PND94W11];
LTdata=Data(1:77,:);% Load data from Long term
LTCHSD=CHSD(1:77,1);% Load factor 1 : CHSD
LTPhA=PhA(1:77,1);% Load factor 1 : PhA
%%%%%%%%%%%%%%%%Store the data in a table array.
t = table(LTCHSD,LTPhA,LTdata(:,1),LTdata(:,2),LTdata(:,3),LTdata(:,4),'VariableNames',{'LTCHSD','LTPhA','meas1','meas2','meas3','meas4'});
Meas = table([1 2 3 4]','VariableNames',{'Measurements'}); % Repeated measure part of data loading table
%%%%%%%%%%%%%%%%%%Fit a repeated measures model, where the measurements are the responses and the species is the predictor variable.
rm = fitrm(between,'meas1-meas4~LTCHSD*LTPhA','WithinDesign',Meas);
% Descriptive data
GS = grpstats(rm,{'LTCHSD','LTPhA'},{'mean','std',@skewness,@kurtosis}); %%%%%%%%%%%%%%%%%%%%Perform repeated measures analysis of variance.
ranovatbl = ranova(rm);
disp(ranovatbl)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!