MATLAB: Using aoctool for a 1-way ANCOVA (+plot)

plotstatistics

I have two groups of subjects, each with scores on a memory task and on an IQ test. I would like to check whether there's a significant group difference in the memory measure while controlling for IQ.
I reckoned that for that, I need a 1-way between-subjects ANCOVA, with DV=memory score, predictor=group, and covariate=IQ. The Matlab command to achieve this appears to be aoctool.
Following the example in its (rather incomplete) documentation , and having coded group as a categorical variable, I typed:
[h,a,c,s] = aoctool(PIQ, mem, group, 0.05, 'PIQ','mem','group','off','separate lines');
However, that just gives me the slopes&intercepts for the groups, which does not help me. What I need is a categorical comparison between the groups, rather than a regression between x vs y, as the aoctool example seems to put it.
How can I use aoctool to:
  1. obtain a p-value for the between-subjects effect of the group factor?
  2. scatter-plot the memory score as a function of IQ, with groups color-coded as in the documentation example? The above command does return a figure handle h, but it's an empty matrix (even in the case of the example dataset!), and I don't think it can be used to base a plot on it.
Thanks for any help!

Best Answer

Hey,
Unfortunately, I also do not know how to get what you want using aoctool. However, given that no one else has replied so far, I thought you might be interested in alternative ways...
As I just tried to solve a similar problem, I came across these two solution, which both work fine for carrying out an ACOVA as you described: 1. There is a tool on matlabcentral fileexchange, which I found very useful and easy to use: https://de.mathworks.com/matlabcentral/fileexchange/27014-mancovan
2. Brani Vidakovic gives code examples in the book "Engineering Biostatistics: An Introduction using MATLAB and WinBUGS". I think, Example 14.8. describes almost exactly what you want, so you can just re-program what is shown in the book.
Best, Matthias