Disable aoctool interactive pop up window
2 次查看(过去 30 天)
显示 更早的评论
When using aoctool (ANCOVA), is there a way to disable the interactive pop up window?
Specifically, I am interested in live script usage. I came across the 'display' option, which turns off both the pop up window and the ANOVA Table output but that's not what I am looking for. Ideally, I woul like to see the figure in the output panel of the live script as well as the ANOVA table but not see the pop up figure.
Sample code:
[h,atab,ctab,stats] = aoctool(age, sample, group)
Many thanks to everyone in advance!
0 个评论
回答(1 个)
Aditya
2024-2-19
Unfortunately, aoctool does not have an inherent option to disable the pop-up window while still displaying the results within the live script output panel. The 'Display' option, as you mentioned, turns off all displays, including the ANOVA table output.
As a workaround, you can consider using the lower-level functions that aoctool uses internally to perform the ANCOVA without the GUI. These functions can provide the statistical output without the interactive components. The anovan function is one such option that can perform ANCOVA analysis and return similar statistical outputs.
Here's an example of how you might use anovan to get the ANCOVA results without the pop-up window:
% Assuming 'age' is your covariate, 'sample' is your response variable,
% and 'group' is your factor (grouping variable).
% Perform ANCOVA using anovan
[p,atab,stats] = anovan(sample, {group, age}, 'continuous', 2, 'varnames', {'Group','Age'});
% Display the ANOVA table in the command window or live script output
disp(atab);
% If you want to generate the figure yourself, you can use the stats output
% to create plots manually. For example, to create a basic interaction plot:
interactionplot(sample, {group, age}, 'varnames', {'Group','Age'});
This code will perform the ANCOVA and display the ANOVA table without generating the interactive GUI. You can also generate plots manually using the statistical information returned in stats.
Remember to adjust the inputs to anovan according to your specific needs, such as specifying model types or other options.
While this does not replicate the exact behavior of aoctool within a live script, it provides a non-interactive alternative that may be suitable for your needs when working with scripts and live scripts.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!