Object Oriented Microarray Library: Two-Group Statistics
The two-group statistics module provides the
definition of the
two.group.statistics
class.
See the bottom of the page for an example of how the class can be used.
Class Name: two.group.stats
Attributes
- n1
- An integer, the number of items in the first group.
- mean1
- The gene-by-gene vector of means for the first group.
- var1
- The gene-by-gene vector of variances for the first group.
- n2
- An integer, the number of items in the second group.
- mean2
- The gene-by-gene vector of means for the second group.
- var2
- The gene-by-gene vector of variances for the second group.
- overall.mean
- The gene-by-gene vector of means for the combined groups.
- overall.var
- The gene-by-gene vector of variances for the combined groups.
- pooled.var
- The gene-by-gene vector of variances for the combined groups
combined by pooling the estimates for the two groups, using the
standard formulas from, for example, the t-test.
Methods
- two.group.stats(data, split)
- Constructor. The required arguments are a data frame,
data
, and a logical vector, split
, which
is used to classify the columns of the data frame into two groups.
- summary(object, ...)
- Write out a summary of the object.
- print(object, ...)
- Print all the information in the object.
- plot(object, name, aname, bname, ...)
- This method produces six different plots of the object. Only the
object argument is required. The optional
aname
,
bname
, and name
arguments are usd as title
for the first three plots, respectively. The plots are:
- A plot of the vector of standard deviations from the first
group as a function of the means.
- The same thing for the second group.
- The same thing for the combined groups.
- A plot of the difference in means as a function of the
overall means, along with a loess fit.
- A plot of the difference in means as a function of position,
together with a loess fit.
- A comparison of the overall mean with the pooled mean.
- as.data.frame(object)
- Convert the object to a data frame, which contains all the
information except the values
n1
andn2
.
Description
An object of the two.group.stats
class
is constructed from a data frame containing N rows (genes) and P
columns (samples), along with a logical vector of length P that
separates the samples into two groups. On a gene-by-gene basis, we
compute the mean and variance, along with the pooled variance for
combining the two groups.
Example
bogus <- matrix(rnorm(30*1000, 8, 3), ncol=30, nrow=1000)
splitter <- rep(F, 30)
splitter[16:30] <- T
x <- two.group.stats(bogus, splitter)
summary(x)
opar<-par(mfrow=c(2,3), pch='.')
plot(x)
par(opar)