Problem using ranova for analysis of variance
5 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to use ranova to analyse data from a fairly simple experiment, but am not successful as yet. The data (60x3) are attached. There were 60 teenage participants. The 1st column contains the measures on the dependent variable, grip strength. The 2nd and 3rd columns contain grouping codes for two independent variables, gender (m, f) and dietary group (dg1, dg2, dg3). So, there were 2x3=6 groups with 10 participants per group.
ranova seems to be the most flexible and powerful of MATLAB's anova functions, and I've had success with it in the past. But I'm coming up empty so far with this design. Here's the code I'm using:
T = readtable('testdata.txt');
T.Properties.VariableNames = {'DV', 'Gender', 'DietaryGroup' };
rm = fitrm(T,'DV ~ Gender-DietaryGroup','WithinDesign',table(1,'VariableNames',{'GripStrength'}));
AT = ranova(rm, 'WithinModel', 'GripStrength')
The output table includes an effect for gender but not for dietary group. As usual for a design like this, I need a main effect for each independent variable and also the interaction effect.
AT =
6×8 table
SumSq DF MeanSq F pValue pValueGG pValueHF pValueLB
________________ __ ________________ ________________ ____________________ ____________________ ____________________ ____________________
(Intercept) 132155.818801667 1 132155.818801667 1710.03811173231 9.71642961217613e-45 9.71642961217613e-45 9.71642961217613e-45 9.71642961217613e-45
Gender 783.442935000001 1 783.442935000001 10.1374066565166 0.00233737408952656 0.00233737408952656 0.00233737408952656 0.00233737408952656
Error 4482.37816333333 58 77.2823821264368
(Intercept):GripStrength 132155.818801667 1 132155.818801667 1710.03811173231 9.71642961217613e-45 9.71642961217613e-45 9.71642961217613e-45 9.71642961217613e-45
Gender:GripStrength 783.442935000001 1 783.442935000001 10.1374066565166 0.00233737408952656 0.00233737408952656 0.00233737408952656 0.00233737408952656
Error(GripStrength) 4482.37816333333 58 77.2823821264368
Any help you can offer is greatly appreciated.
0 件のコメント
採用された回答
Peter Perkins
2021 年 7 月 26 日
Scott, haven't you explicitly not included DietaryGroup with that minus sign? I think you are using it for predictors in a way that's only valid in the response specification.
3 件のコメント
Peter Perkins
2021 年 7 月 27 日
I'm afraid ranova goes beyond my knowledge. I assume by "garbage" you mean "unrealistic estimates", and not "those lines should not be there".
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Repeated Measures and MANOVA についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!