Home > brede > brede_mat_glm.m

brede_mat_glm

PURPOSE ^

brede_mat_glm - General linear model

SYNOPSIS ^

function M = brede_mat_glm(X, Y, varargin)

DESCRIPTION ^

 brede_mat_glm        - General linear model

       M = brede_mat_glm(X, Y)

       Input:    X  Design matrix
                 Y  Dependent variable

       Property: C  [ {identity matrix} | a matrix or a vector ]
                    Contrast matrix 

       Output:   M  'Mat' structure with statistics

       Estimate and test in the mass-univariate "general linear model": 

                            Y = XB + U

       First input argument should be a design matrix where the
       columns are the design variables. The second input argument is
       the dependent variable - typically with measured data. 

       'C' is the contrast matrix for testing: C*B = 0. If this is a
       row vector then the test will be a t-test. If it is a matrix
       an F-test will be made. 

       By default the output is a 'mat' structure where the first row
       in the matrix correspond to the z-score; the second to the
       t-score (or F-score); the third to the upper tail area and the
       fourth to the two-tailed area.

       For the t-test the "contrast image" computed as C*B is returned
       as the fifth row.

       Example:
         X = rand(12,5);
         Y = randn(size(X,1), 2000);
         M = brede_mat_glm(X, Y);
         figure, hist(M.matrix(3,:), round(sqrt(size(M.matrix,2))))
         title('Histogram of P-values')
 
         % With F-contrast
         M = brede_mat_glm(X, Y, 'C', [1 0 0 0 0 ; 0 1 0 0 0])
         figure, hist(M.matrix(3,:), round(sqrt(size(M.matrix,2))))

         % With t-contrast
         M = brede_mat_glm(X, Y, 'C', [ 1 -1 0 0 0]);
         figure, hist(M.matrix(3,:), round(sqrt(size(M.matrix,2))))

       See also BREDE, BREDE_MAT, BREDE_MAT_GLM_EST,
                BREDE_MAT_GLM_TESTABLE.

 $Id: brede_mat_glm.m,v 1.10 2008/04/23 18:50:10 fn Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 27-Nov-2009 18:11:22 by m2html © 2005