Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How do I correctly apply fitrm?

1 vue (au cours des 30 derniers jours)
lil brain
lil brain le 29 Avr 2022
Clôturé : Cris LaPierre le 29 Avr 2022
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!

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by