Repeated measure with 2 between subject factors
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!