centerDataTwoGroupsByModelSelection: Center Each Column Based on Model Selection

Description Usage Arguments Details Value

View source: R/centerDataTwoGroupsByModelSelection.R

Description

This function takes a data matrix and returns a centered data matrix. For columns with indices in within.group.indices, centering is performed by subtracting the corresponding group mean from each entry (i.e. for entries in group one, the group one mean is subtracted, and for entries in group two, the group two mean is subtracted). For other columns, global centering is performed (i.e. subtracting the column mean from each entry).

Usage

1
2
centerDataTwoGroupsByModelSelection(X, group.one.indices,
  group.two.indices, within.group.indices)

Arguments

X

a data matrix.

group.one.indices

indices of observations in group one.

group.two.indices

indices of observations in group two.

within.group.indices

indices of columns on which to perform group centering.

Details

Example

1
2
3
4
5
6
X <- matrix(1:12, nrow=4, ncol=3)
# Group center the first two columns, globally center
# the third column.
X.cen <- centerDataTwoGroupsByModelSelection(
  X, group.one.indices=1:2, group.two.indices=3:4,
  within.group.indices=1:2)

Value

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


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