Learn R Programming

HDTD (version 1.6.0)

meanmat.hat: Estimation the Mean Matrix

Description

This function estimates the mean matrix.

Usage

meanmat.hat(datamat, N, group.sizes = NULL, group.vars = NULL)

Arguments

datamat
numeric matrix containing the transposable data.
N
positive integer number indicating the sample size, i.e., the number of subjects.
group.sizes
numeric vector indicating the size of the row or column groups that share the same mean vector. It should be used only when group.vars="rows" or "columns".
group.vars
character indicating that the mean matrix can be simplified over the row or column variables. Options include "rows" or "columns".

Value

Returns a list with components:
estmeanmat
the estimated mean matrix.
N
the sample size.
n.rows
the number of row variables.
n.cols
the number of column variables.

Details

It is assumed that there are nrow(datamat) row variables and ncol(datamat)/N column variables in datamat. Further, datamat should be written in such a way that every ncol(datamat)/N consecutive columns belong to the same subject and the order of the column variables in each block is preserved across subjects.

Examples

Run this code
data(VEGFmouse)
## The sample mean matrix of the VEGF mouse data.
sample.mean <- meanmat.hat(VEGFmouse,40)
sample.mean
sample.mean$estmeanmat

Run the code above in your browser using DataLab