DESCRIBING INPUT AND OUTPUT ARGUMENTS

This file describes the input/output arguments 

INPUT ARGUMENTS: y,s1,s2,model,B,outfilep,outfilen

y        : (n x 1) vector of disease status (1 for diseased individual, 0 for disease-free individual) for n individuals,

s1       : (n x m1) the design matrix for a class of covariates the (e.g. 'm1' marker SNPs in a candidate gene) association of which with the disease is to be tested

s2       : (n x m2) the design matrix for second class of covariates (e.g 'm2' markers SNPs in a second candidate gene) which can interact with the covariates in S1 

model    : 1 for LogMain, 2 for LogMain&Int, 3 for TukAssoc. e.g. if you want to apply all of them then model=[1 2 3] or e.g.
           if you want to apply only TukAssoc, then model = [3]. 

B        : number of permuted data sets to be used for the permutation based p-value

outfilep : name of the file where permutation-based null distributions will be written

outfilen : name of the file where asymptotic-based null distribution for TukAssoc will be written

NOTES  
note 1   : The code has been documented assuming s1 and s2 denote the design matrix for SNP genotype data (coded as 0,1,2)            for m1 and m2 SNPs respectively, in two candidate genes. The program, however, can be used to test for            association for any group of covariates (the design matrix for which is s1) after accounting for their            interaction with another group of covariates (the design matrix for which is s2).  For example, S1 could be            the design matrix for tagging SNPs in a candidate gene and s2 could the design matrix for a class of related                 environmental covariates.
note 2   : s1 should always correspond to the design matrix for the class of covariates which are being tested for            association
note 3   : the numbers in the input argument 'model' have to be ordered          


OUTPUT ARGUMENTS: A, outfilep, outfilen

A                  : whole or sections of the following 3x3 matrix A depending on your input argument 'model' 
A                  = [t_logmain      p_logmain_perm      p_logmain_asymp 
                      t_logmain_int  p_logmain_int_perm  p_logmain_int_asymp 
                      t_tukassoc     p_tukassoc_perm     p_tukassoc_asymp] 
where
t_logmain          : test statistic for the 'm' degrees of freedom main-effect-based test (LogMain),
p_logmain_perm     : permutation based p value for the LogMain,
p_logmain_asymp    : asymptotic based p value for the LogMain (chisquare(dof=m)), 

t_logmain_int      : test statistic for the (m+m*z)degrees of freedom test based on the saturated model of interaction (LogMain&Int), 
p_logmain_int_perm : permutation based p value for the LogMain&Int,
p_logmain_int_asymp: asymptotic based p value for the LogMain&Int (chisquare(dof=m+m*z)),

t_tukassoc         : the proposed test (TukAssoc),
p_tukassoc_perm    : permutation based p value for the TukAssoc,
p_tukassoc_asymp   : asymptotic based p value for the TukAssoc,

outfilep           : file where permutation-based null distributions are stored

outfilen           : file where asymptotic-based null distribution for TukAssoc is stored

AN EXAMPLE:

data     = load('testdata.dat');
y        = data(:,1);
s1       = data(:,2:7);
s2       = data(:,8:13);
model    = [1 2 3];
B        = 10000;
outfilep = 'perm.dat';
outfilen = 'asymp.dat';
t        = multilocus_tests(y,s1,s2,model,B,outfilep,outfilen);



