Why Matlab give me the error that "the between-subjects design must have full column rank"?
8 views (last 30 days)
Show older comments
Hi everyone, here's the problem. I want to analize datas about glycemic values in 10 days for 4 conditions with the test "ranova". I have created a matrix "condition" [10x4], then a cell array [10x1] "timing" with moments of data collection, a table t=table(timing,condition(:,1),condition(:,2),condition(:,3),condition(:,4),'VariableNames',{'timing','all_1','all_2','all_3','ctrl'}), and then a table [4x1] Meas=([1 2 3 4]','VariableNames',{'Measurements'}). When I try to do the function rm=fitrm(t,'all_1-ctrl~timing','WithinDesign',Meas) Matlab gives me the error that the between-subjects design must have full column rank and I can't find the reason why is that. Can you help me please?
1 Comment
Saurabh
on 12 Dec 2024
Could you please format the code to make it easier to read and understand? Additionally, could you let me know which version of MATLAB you are using for this operation? Thank you!
Answers (1)
Debadipto
on 18 Dec 2024
The column rank error likely occurs because of the "timing" variable. This can happen if "timing" does not represent independent levels or lacks sufficient variability to maintain a full column rank. For example, if "timing" contains identical values (e.g., 'Day 1' for all rows), it eliminates any variability in the between-subjects factor, making 'timing" collinear and causing a rank deficiency. Ensure that "timing" accurately represents the moments of data collection, avoiding duplicate or constant values that could result in a singular matrix in the design.
0 Comments
See Also
Categories
Find more on Startup and Shutdown 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!