Info

此问题已关闭。 请重新打开它进行编辑或回答。

How do I correctly apply fitrm?

1 次查看(过去 30 天)
lil brain
lil brain 2022-4-29
关闭: Cris LaPierre 2022-4-29
Hi,
I have a data set with two conditions ("H" and "L") and 36 participants. Each participant was measured five times in phases called "pre", "balls", "between", "basket" and "post". This information is stored in the variable "comptable_both_conditions".
I am interested in running a RM ANOVA to see if there are within group differences between the phases.
Here is my code:
condition = ...
['H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' 'H' ...
'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' 'L' ]';
% assigning each participant to a condition
t = table(condition,comptable_both_conditions(:,1),...
comptable_both_conditions(:,2),comptable_both_conditions(:,3),...
comptable_both_conditions(:,4),comptable_both_conditions(:,5),...
'VariableNames',{'groups','pre','balls','btw','basket','post'});
% creating the table for the RM ANOVA
Meas = table([1 2 3 4 5]','VariableNames',{'Measurements'});
rm = fitrm(t,'pre-post ~ condition','WithinDesign',Meas);
I am unsure if this is correct. Also, when running the code I get an error which I cant seem to find online:
Undefined function 'fitrm' for input arguments of type 'table'.
Any help would be greatly appreciated!
Thanks!

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by