Problem using ranova for analysis of variance
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Scott MacKenzie
le 22 Juil 2021
Modifié(e) : Scott MacKenzie
le 27 Juil 2021
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 commentaires
Réponse acceptée
Peter Perkins
le 26 Juil 2021
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 commentaires
Peter Perkins
le 27 Juil 2021
I'm afraid ranova goes beyond my knowledge. I assume by "garbage" you mean "unrealistic estimates", and not "those lines should not be there".
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Repeated Measures and MANOVA dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!