View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.8 | 6 ratings Rate this file 24 Downloads (last 30 days) File Size: 5.57 MB File ID: #27014 Version: 1.16




19 Mar 2010 (Updated )

Tools for Multivariate Analysis (Statistics Toolbox NOT Required)

| Watch this File

File Information

MANCOVAN provides a suite of tools for testing for group, group-group interaction, covariate, covariate-covariate interaction, and group-covariate interaction effects in the context of a multivariate response and it does so without using the Statistics Toolbox. Because MANCOVAN represents such a general model, it can be used for ANOVA, ANOVAN, ANCOVA, ANCOVAN, MANOVA, MANOVAN, and MANCOVA as well without loss of power or precision. In addition to MANCOVAN, this suite of tools includes MSTEPWISE for multivariate stepwise regression, MT for t-tests among levels of a group or for the slope of the regression line associated with a covariate, a variety of functions for creating and using custom design matrices, and plenty of examples.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
25 Sep 2016 Pavel Voinov

22 Sep 2016 Pavel Voinov

12 Dec 2014 Darren Price

Great, but is there a more detailed explanation of how to use this toolbox. I am trying to make a model with 1 dependent variable, 2 covariates, and 2 groups. I want to design a model that tests the interaction between group and covariate 1, but not covariate 2 (covariate 2 is just a nuisance variable).


01 Dec 2013 Right Grievous

Worked it out myself - for anyone else who might be interested the info can be displayed using the 'verbose' option - this only displays in the command window though, so I edited mLHT.m to output an additional stats table with the DoF and p values, I then get mancova.m to add F values to this to create a really condensed but highly useful second stats table...

Comment only
01 Dec 2013 Right Grievous

Great submission, I was wondering if you could tell me what the degrees of freedom are for the ANCOVA? In statistics programs like SPSS it outputs two degrees of freedom, 'treatments and error' or 'withing and between' both of which are required to report the test result. But when I run your MANCOVAN it only outputs one degree of freedom... Sorry in advance if this is a stupid question.

30 Jan 2012 Arnaud Messé

Dear William,
Thanks for providing the MANCOVAN tools, it's a nice work!
In the mT function notes, you said:
"The tests may not always be the right ones in the context of either over-determined or sigma-restricted coding."
Could you argue this comment?
I have trouble to understand the canonical coding used... Because, this does not allow to compute all possible between groups comparisons. Is that correct?
Thanks in advance,

09 Mar 2011 Chris Allen

17 Sep 2010 Claus Andersen

Dear William Gruner,
Thanks for providing MANCOVA on the exchange server.
I've tried to use MANCOVA for an ANCOVA analysis, but sometimes get an error. The error occurs more frequently the more similar the two groups compared are (running Monte Carlo sim, so I impose the similarity).

The error reads:
??? Error using ==> betainc
X must be in the interval [0,1].

Error in ==> mFCDF at 44
p = betainc(a * x ./ (a * x + b), a/2, b/2);

Error in ==> mLHT at 79
p = 1 - mFCDF(G * T, q * d, D);

Error in ==> mancovan at 236
[ T(i), p(i) ] = mLHT(U, X, X0, M, M0, options);

Possibly you'd be interested in checking it out.
If need be I can also mail you the test data used.

Comment only
11 Apr 2010 William Gruner

Thanks for the comment! I'm sure others share your concern. We've been refactoring and expanding the feature set very rapidly as our analysis tasks become more demanding, but each new release is both validated against the Matlab Statistics Toolbox and regression tested against earlier versions to make sure that the results remain correct and that the functionality remains backward-compatible. Brace yourself, because there's another update coming soon ;-) After that, I expect things to slow down markedly. Cheers!

Comment only
10 Apr 2010 Mark Shore

Just a thought that I'm certain has crossed the mind of most people looking at the update history of this submission... with nine(!) updates in 22 days, does the author consider this to be mature software ready for wider dissemination?

Comment only
19 Mar 2010 1.3

Added an automatic dimensionality-reduction step based on the Bayesian information criterion for cases in which the number of columns of Y exceed the number of rows by a number that causes the test statistic to fail.

20 Mar 2010 1.7

The Bayesian information criterion and SVD results can now be recovered as part of the output and a myriad of useful publication-quality graphics may now be generated automatically. See the help text for details.

22 Mar 2010 1.8

Added an option to evaluate group-group interactions and added additional figures, verbose output, and comments. Confirmed that the values returned in pANCOVA are identical to those returned by anovan in the absence of covariates.

22 Mar 2010 1.9

Removed the dependence on the Statistics Toolbox. This means that ANOVA, ANCOVA, ANOVAN, ANCOVAN, MANOVA, MANCOVA, MANOVAN, and MANCOVAN can all be performed with a single function with no dependencies other than Matlab itself.

23 Mar 2010 1.10

Added options to test for covariate-covariate and group-covariate interactions, an option to print figures to PDF, and a debug mode that interactively displays the full and reduced design matrices associated with each test.

23 Mar 2010 1.11

Changed ANCOVA to ANCOVAN in the description.

05 Apr 2010 1.12

This update replaces the single function, MANCOVAN, with a suite of tools that not only implement this model, but also provide multivariate stepwise regression, t-tests, customization of the design matrix, and much more.

06 Apr 2010 1.13

Removed the temp parent directory from the ZIP file.

07 Apr 2010 1.14

These tools are now compatible with GNU Octave Version 3.2.2. In addition, the way mStepwise.m removes terms has been improved and a few convenience functions have been added for finding and using model terms.

09 Apr 2010 1.15

Revision 492 uses a sigma-restricted coding scheme to generate design matrices because the resulting regression coefficients are much easier to interpret. It also includes several improvements to the t-test engine, mT.m.

15 Apr 2010 1.16

Fixed a bug in mStepwise.m that sometimes caused p-values to be returned in sorted order, made the canonical coding of the design matrix described in mG2X.m the default, and added options for sigma-restricted and over-determined coding.

Contact us