When I use ranova I have as output only NaN
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello everyone, I am writing to you because I have a problem when I use the ranova command.
I am trying to perform a two-way repeated measures ANOVA and as a result I get a table with only NaN:
(Intercept):Time 0 0 NaN NaN NaN NaN NaN NaN
Factor1:Time 0 0 NaN NaN NaN NaN NaN NaN
Factor2:Time 0 0 0 NaN NaN NaN NaN NaN NaN
Factor1:Factor2:Time 0 0 0 NaN NaN NaN NaN NaN NaN NaN
Error(Time) 0 0 NaN.
I also show you how I made this ANOVA:
data = table(ID, Factor1, Factor2, DV);
rm = fitrm(data, 'DV ~ Factor1*Factor2', 'WithinDesign', {'Factor1', 'Factor2'});
anovaTable = ranova(rm);
disp(anovaTable);
I specify that I have the Statistical and Machine Learning toolbox.
Thanks to anyone who will help me understand where I am wrong.
1 comentario
the cyclist
el 7 de Jun. de 2023
Can you upload the data? You can use the paper clip icon in the INSERT section of the toolbar.
Respuestas (1)
Aditya
el 14 de Nov. de 2023
Hi Tanbeer,
I understand that you are facing a problem with ranova command. Try the following steps , these might help you.
The issue you're encountering with the `ranova` command and obtaining NaN values in the ANOVA table might be due to missing data or unbalanced designs in your data. Here are a few suggestions to help you troubleshoot and resolve the problem:
1. Check for missing data: Ensure that your data does not contain any missing values. You can use the `isnan` function to identify and handle missing values appropriately before performing the ANOVA.
2. Check for unbalanced designs: Verify that your data has a balanced design, meaning an equal number of observations for each combination of Factor1 and Factor2 levels. If your design is unbalanced, it can lead to NaN values in the ANOVA table. Consider balancing your design or using alternative statistical methods suitable for unbalanced data.
3. Check the levels of Factor1 and Factor2: Make sure that the levels of both factors are correctly defined and assigned in your data. Ensure that there are no spelling or formatting inconsistencies that could affect the ANOVA results.
4. Verify the variable types: Ensure that the variables used in the ANOVA are of the appropriate type. For example, Factor1 and Factor2 should be categorical variables, and DV should be a numeric variable.
5. Update MATLAB and the Statistics and Machine Learning Toolbox: Ensure that you have the latest version of MATLAB and the Statistics and Machine Learning Toolbox installed. Updating to the latest version can help resolve any potential bugs or issues related to the `ranova` function.
Hope this helps.
Thanks and Regards,
Aditya Kaloji
0 comentarios
Ver también
Categorías
Más información sobre Repeated Measures and MANOVA en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!