Why Matlab give me the error that "the between-subjects design must have full column rank"?
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
Saurabh
2024-12-12
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!
回答(1 个)
Debadipto
2024-12-18
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!