data.form: Convert input data into appropriate format for TANOVA
Description
This is an internal function to be called by tanova to format input data into appropriate format.
Users should call tanova whenever is possible.
Usage
data.form(data, f1, f2, tp)
Arguments
data
data matrix (gene * array). Each row is a gene. Each column is an array.
If data is longitudinal (e.g., time course measurements from patients), arrays
from same experimental units (e.g. patient) should be next to each other (but not necessary in time course order.
f1
a vector of length equal to the number of arrays. Each entry indicates the
level of the first factor for corresponding array. The values of f1 should be numeric 1,2,3...
f2
a vector of length equal to the number of arrays. Each entry indicates the
level of the second factor for the corresponding array. The values of f2 should be numeric 1,2,3...
If there's only one factor, let f2=0.
tp
a vector of length equal to the number of arrays. Each entry indicates
the time point for the corresponding array. The values of tp should be numeric 1,2,3 ... For non-time
course data, let tp=0.
Value
The output is a list object.
d
data matrix. nrow=#genes*#time points, ncol=factor levels (#factor1*#factor2). Rows are
ordered by gene name and then by time points.
fc1
a vector of length equal to the number of arrays divided by the number of time points.
Each entry indicates the level of the first factor for the group of arrays with the same combination of
factor levels. The values of fc1 should be numeric 1,2,3...
fc2
a vector of length equal to the number of arrays divided by the number of time points.
Each entry indicates the level of the first factor for the group of arrays with the same combination of
factor levels. The values of fc1 should be numeric 1,2,3...