multi_mantel
A program for multiple matrix regression and hypothesis testing.
by Liam J. Revell

Contents


1.  Getting started

2.  Running multi_mantel

3.  The output

4.  References and further reading

5.  Contact information

7.  Appendix - updates

Getting Started

Introduction

Multi_mantel is a program for multiple matrix regression and hypothesis testing by the Mantel procedure following Mantel (1967). Multi_mantel conducts a multiple linear regresion in the typical way, but evaluates significance by permuting the dependent matrix many times. This approach is designed to analyze matrices with a constant on the diagonal - i.e., distance matrices in which elements in the diagonal have a constant value of 0; or correlation matrices in which elements in the diagonal have a value of 1.0.

Multiple matrix regression first constructs a linear multiple regression model as follows:

in which Y is the dependent matrix, β0 is the intercept, βi is the partial regression coefficient of the independent matrix Xi on Y, and E is a matrix of error.

Since the elements of Y (and all Xi) are non-independent, statistical hypothesis testing about the linear model cannot be conducted in a typical manner. Instead, Mantel (1967) suggested testing the hypothesis of no association between the matrices by simultaneously permuting rows and columns together in the dependent matrix.

Installation - Linux/UNIX

The source, this manual, all available executables, and an example data file are available as a zipped tarball multi_mantel.tar.gz.

To install in Linux/UNIX, download the source multi_mantel.c to your programs directory or other appropriate directory, e.g., /home/your_user_name/programs/multi_mantel/multi_mantel.c.
Before compiling multi_mantel, first check the status of your gcc compiler:



You should see some variant of the above message. If not, you need to install a gcc compiler. See the following link for help.

To compile, type the following command:



If your terminal window looks like that after compiling multi_mantel, you're probably in good shape.

Installation - Windows

Unfortunately, multi_mantel is not a real Windows program. However it has been compiled for Windows and can be executed from the Command Prompt in Windows or by double-clicking on the executable.

Most Windows installations do not come packaged with a compiler, so I'm distributing the executable and hopefully that will work on your system (it should). The link to that executable is here. If you'd like to download a compiler to compile multi_mantel from source in Windows, I recommend MinGW.

Back to top

Running multi_mantel

Input file format

Input files should be created as plain text which can be accomplished in Linux by using a text editor such as gedit or in Windows by using WordPad and saving in Save as Type: Text Document Format. Many people will be using Microsoft excel for data compilation - in which you should save as 'tab delimited text.'

Several different input file formats are accepted by multi_mantel. The program can accept matrices in full matrix form, in lower diagonal form, or in upper diagonal form. I plan to also add the capability to accept unfolded matrices, however this feature is not functioning at present.
The input file format for full matrices is as follows:

Alternatively, a lower diagonal matrix input file is shown here:

In both input files, the header contains two numbers - the number of matrices (three in this example) and the number of rows or columns in each matrix (five).

NOTE ON FILE FORMAT- This program will probably be finicky about file format, so be careful to follow the format presented herein and the format of the example data file available with multi_mantel.

Running multi_mantel

Running multi_mantel is easy. In Windows XP, you should be able to run the executable multi_mantel.exe simply by double clicking on it. If you'd prefer, you can also run it from the command prompt. The easiest way to get a command prompt in XP is to open a RUN window and enter:



At the command prompt, navigate to the appropriate directory and type:


To run in Linux/UNIX navigate to the appropriate directory and type:


From here on out execution in Linux/UNIX and Windows are identical, so I will follow execution in Linux/UNIX.

The program will give you several prompts:



When prompted for input file, enter the name of the data file to be analyzed. Then enter the name of a file for output. Any existing file with this name will be overwritten without warning! The results, with the exception of the residual and predicted matrices, are also printed to screen. The permutation aspect of the program is quite fast, so selecting a very large number (105 or 106) is not unreasonable.

Back to top

The multi_mantel output

The general output from multi_mantel is printed to an output file and looks as follows:


The user should refer to standard statistical textbooks for interpretation of the results. A good one for biologists dealing with multivariate analyses is Experimental Design and Data Analysis for Biologists by Quinn and Keough.

Back to top

References

1. Mantel, N. 1967. The detection of disease clustering and a generalized regression approach. Cancer Research 27:209-220.

2. Manly, B.F.J. 2006. Randomization, Bootstrap and Monte Carlo Methods in Biology. 3rd Ed. Chapman & Hall, London.

Back to top

Contact information

Please contact me by email with any questions, or if you find the program useful. My email is lrevell@fas.harvard.edu, and my other contact information is listed below.

Although I have thoroughly tested the program, I encourage users to do the same and I would be happy to hear about any bugs you might find.

Liam J. Revell
Department of Organismic and Evolutionary Biology
Harvard University
Cambridge, MA 02138
(314) 935-7256

Back to top

Appendix

Updates

DateUpdate
Oct. 19, 2006Error = possible memory overflow in matrix inversion. Fixed.
Oct. 2, 2007Error = possible memory problem with large matrices. Fixed.

Back to top


Content copyright. Last updated 3 Oct. 2007.