Anova 1 results into a matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Cside
el 7 de Oct. de 2019
Respondida: Michal
el 7 de Oct. de 2019
Hi,
I have a code that loops and returns with their respective Anova 1 analysis. How may I write for a code that automaticlly inputs the results into one matrix?
Thanks!
0 comentarios
Respuesta aceptada
Michal
el 7 de Oct. de 2019
Hi,
it depends on what results you would like to get.
You can get the full ANOVA table from anova1 as a cell array.
[~,table] = anova1(y)
Then you can simply store each ANOVA table in a cell array.
for i = 1:number_of_loops % number_of_loops should be equal to how many loops you want to run
[~,table] = anova1(y);
all_results{i} = table;
end
If you would like to get just one result from the ANOVA table you can store it in a matrix in a similar way to the above. Let's say you are interested in the F statistic:
for i = 1:number_of_loops % number_of_loops should be equal to how many loops you want to run
[~,table] = anova1(y);
F_statistic(i) = table{2,5}; % make sure you check that the F statistic of your ANOVA can be found at those indices - (2,5)
end
You can easily work out indices of any of the results by looking at the ANOVA table.
Hope this helps.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre ANOVA 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!