Class to fit multiple (row-by-row) linear (fixed-effects) models on microarray or proteomics data.
1 2 3 4 5 6 7 8 9 10 11 12 13
MultiLinearModel(form, clindata, arraydata) ## S4 method for signature 'MultiLinearModel' summary(object, ...) ## S4 method for signature 'MultiLinearModel' hist(x, xlab='F Statistics', main=NULL, ...) ## S4 method for signature 'MultiLinearModel,missing' plot(x, y, ylab='F Statistics', ...) ## S4 method for signature 'MultiLinearModel,ANY' plot(x, y, xlab='F Statistics', ylab=deparse(substitute(y)), ...) ## S4 method for signature 'MultiLinearModel' anova(object, ob2, ...) multiTukey(object, alpha)
either a data frame of "clinical" or other
covariates, or an
matrix or data frame of values to be explained by the model.
object of class
object of class
object of class
optional numeric vector
character string specifying label for the x-axis
character string specifying label for the y-axis
character string specifying graph title
extra arguments for generic or plotting functions
numeric scalar between
anova method returns a data frame. The rows in the data
frame corresponds to the rows in the
arraydata object that was
used to construct the
MultiLinearModel objects. The first
column contains the F-statistics and the second column contains the
multiTukey function returns a vector whose length equals
the number of rows in the
arraydata object used to construct
MultiLinearModel. Assuming that the overall F-test was
significant, differences in group means (in each data row) larger than
this value are significant by Tukey's test for honestly significant
difference. (Of course, that statement is incorrect, since we haven't
fully corrected for multiple testing. Our standard practice is to take
the p-values from the row-by-row F-tests and evaluate them using the
beta-uniform mixture model (see
Bum). For the rows that
correspond to models whose p-values are smaller than the
cutoff, we simply use the Tukey HSD values without further
Objects should be created by calling the
function. The first argument is a
the linear model, in the same manner that it would be passed to
lm. We will fit the linear model separately for each
row in the
arraydata matrix. Rows of
attached to the
clindata data frame and are always referred to
as "Y" in the formulas. In particular, this implies that
clindata can not include a column already called "Y". Further,
the implementation only works if "Y" is the response variable in the model.
The BioConductor packages uses an
ExpressionSet to combine microarray
data and clinical covariates (known in their context as
phenoData objects) into a single structure.
You can call
MultiLinearModel using an
clindata argument. In this case, the function extracts
phenoData slot of the
ExpressionSet to use for the
clinical covariates, and extracts the
exprs slot of the
ExpressionSet object to use for the array data.
call object describing how the object
formula object specifying the linear
A numeric vector of F-statistics comparing the linear model to the null model.
A numeric vector containing the p-values associated to the F-statistics.
matrix of the coefficients in
the linear models.
matrix of the (Y-hat) values
predicted by the models.
A numeric vector of the sum of squared error terms from fitting the models.
A numeric vector of the sum of squared regression terms from the model.
A numeric vector (of length two) containing the degrees of freedom for the F-tests.
Write out a summary of the object.
Create a histogram of the F-statistics.
Plot the F-statistics as a function of the row index.
Plot the F-statistics against the numeric vector
Perform row-by-row F-tests comparing two different linear models.
MultiLinearModel constructor computes row-by-row F-tests
comparing each linear model to the null model Y ~ 1. In many
instances, one wishes to use an F-test to compare two different linear
models. For instance, many standard applications of analysis of
variance (ANOVA) can be described using such a comparison between two
different linear models. The
anova method for the
MultiLinearModel class performs row-by-row F-tests comparing
two competing linear models.
The implementation of
MultiLinearModel does not take the naive
approach of using either
apply or a
for-loop to attach rows one at a time and fit separate
linear models. All the models are actually fit simultaneously by a
series of matrix operations, which greatly reduces the amount of time
needed to compute the models. The constraint on the column names in
clindata still holds, since one row is attached to allow
model.matrix to determine the contrasts matrix.
Kevin R. Coombes firstname.lastname@example.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
showClass("MultiLinearModel") ng <- 10000 ns <- 50 dat <- matrix(rnorm(ng*ns), ncol=ns) cla <- factor(rep(c('A', 'B'), 25)) cla2 <- factor(rep(c('X', 'Y', 'Z'), times=c(15, 20, 15))) covars <- data.frame(Grade=cla, Stage=cla2) res <- MultiLinearModel(Y ~ Grade + Stage, covars, dat) summary(res) hist(res, breaks=101) plot(res) plot(res, email@example.com) graded <- MultiLinearModel(Y ~ Grade, covars, dat) summary(graded) hist(firstname.lastname@example.org, breaks=101) hist(email@example.com, breaks=101) oop <- anova(res, graded) hist(oop$p.values, breaks=101)
Loading required package: oompaBase Class "MultiLinearModel" [package "ClassComparison"] Slots: Name: call model F.statistics p.values coefficients Class: call formula numeric numeric matrix Name: predictions sse ssr df Class: matrix numeric numeric numeric Row-by-row linear models with 10000 rows Call: MultiLinearModel(form = Y ~ Grade + Stage, clindata = covars, arraydata = dat) F-statistics: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.001182 0.409366 0.799249 1.048185 1.418960 9.435995 P-values: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0000568 0.2493306 0.5006691 0.4981831 0.7470104 0.9999430 Row-by-row linear models with 10000 rows Call: MultiLinearModel(form = Y ~ Grade, clindata = covars, arraydata = dat) F-statistics: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.00000 0.09921 0.45885 1.03144 1.35560 18.63245 P-values: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0000789 0.2500567 0.5014157 0.5021233 0.7541404 0.9999222
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.