# centerDataGLSModelSelection: Center Each Column By Subtracting Group or Global GLS Mean In jointMeanCov: Joint Mean and Covariance Estimation for Matrix-Variate Data

## Description

This function takes a data matrix, an inverse row covariance matrix, group indices (i.e. row indices for membership in groups one and two), and a subset of column indices indicating which columns should be group centered. It returns a centered data matrix. For each group centered column, the two group means are estimated using GLS; then the group one mean is subtracted from entries in group one, and the group two mean is subtracted from entries in group two. For each globally centered column, a single global mean is estimated using GLS and subtracted from each entry in the column. In addition to returning the centered data matrix, this function also returns the means estimated using GLS.

## Usage

 ```1 2``` ```centerDataGLSModelSelection(X, B.inv, group.one.indices, group.two.indices, group.cen.indices) ```

## Arguments

 `X` a data matrix. `B.inv` an inverse row covariance matrix used in GLS `group.one.indices` indices of observations in group one. `group.two.indices` indices of observations in group two. `group.cen.indices` indices of columns to be group centered

## Details

Example

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```n <- 4 m <- 3 X <- matrix(1:12, nrow=n, ncol=m) # Group center the first two columns, globally center # the last column. out <- centerDataGLSModelSelection( X, B.inv=diag(n), group.one.indices=1:2, group.two.indices=3:4, group.cen.indices=1:2) # Display the centered data matrix print(out\$X.cen) ```

## Value

Returns a centered data matrix of the same dimensions as the original data matrix.

 `X.cen` Centered data matrix. `group.means.gls` Group means estimated using GLS; if all columns are globally centered, then `NULL`. `global.means.gls` Global means estimated using GLS; if all columns are group centered, then `NULL`.

jointMeanCov documentation built on May 6, 2019, 1:09 a.m.