stats.util {mt} | R Documentation |
Statistical Summary Utilities for Two-Classes Data
Description
Functions to summarise two-group data.
Usage
stats.vec(x,y, method="mean",test.method = "wilcox.test",fc=TRUE,...)
stats.mat(x,y, method="mean",test.method = "wilcox.test",
padj.method= "fdr",fc=TRUE,...)
Arguments
x |
A data frame or matrix of data set for |
y |
A factor or vector of class. Two classes only. |
method |
|
test.method |
method for p-values from parametric test such as
|
padj.method |
method for p-values correction. Can be one in
|
fc |
a flag for fold-change. |
... |
Additional parameters. |
Value
stats.vec
returns an vector of center, group center, fold change,
log2 fold change, AUC and p-value.
stats.mat
, which is an wrapper function of stats.vec
,
returns an data frame of center, group center, fold change, log2
fold-change, AUC, p-value and adjusted p-values.
Note
If x
has negative values, the results of fold-change and
log2 fold-change are not reliable.
Author(s)
Wanchang Lin
Examples
data(iris)
sel <- c("setosa", "versicolor")
grp <- iris[,5]
idx <- match(iris[,5],sel,nomatch = 0) > 0
cls <- factor(iris[idx,5])
dat <- iris[idx,1:4]
## stats for the single vector
stats.vec(dat[[1]],cls, method = "median",test.method = "wilcox.test")
## use matrix format
tab <- stats.mat(dat,cls, method = "median",test.method = "wilcox.test",
padj.method = "BH")
sapply(tab, class)