Clear Filters
Clear Filters


This question is closed. Reopen it to edit or answer.

How do I correctly apply fitrm?

1 view (last 30 days)
lil brain
lil brain on 29 Apr 2022
Closed: Cris LaPierre on 29 Apr 2022
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),...
% 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!

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!