找回密码
 注册
查看: 922|回复: 0

R语言 genefilter包 rowFtests()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 18:47:03 | 显示全部楼层 |阅读模式
rowFtests(genefilter)
rowFtests()所属R语言包:genefilter

                                        t-tests and F-tests for rows or columns of a matrix
                                         t检验和F检验矩阵的行或列

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

t-tests and F-tests for rows or columns of a
t检验和F检验的行或列


用法----------Usage----------


rowttests(x, fac, tstatOnly = FALSE)
colttests(x, fac, tstatOnly = FALSE)
fastT(x, ig1, ig2, var.equal = TRUE)

rowFtests(x, fac, var.equal = TRUE)
colFtests(x, fac, var.equal = TRUE)



参数----------Arguments----------

参数:x
Numeric matrix. The matrix must not contain NA values. For rowttests and colttests, x can also be an ExpressionSet.
数字矩阵。矩阵必须包含NA值。 rowttests和colttests,x也可以是一个ExpressionSet。


参数:fac
Factor which codes the grouping to be tested. There must be 1 or 2 groups for the t-tests (corresponding to one- and two-sample t-test), and 2 or more for the F-tests. If fac is missing, this is taken as a one-group test (i.e. is only allowed for the t-tests). The length of the factor needs to correspond to the sample size: for the row* functions, the length of the factor must be the same as the number of columns of x, for the col* functions, it must be the same as the number of rows of x.  If x is an ExpressionSet, then  fac may also be a character vector of length 1 with the name of a covariate in x.
分解分组的代码进行测试。必须有1或2组t-检验(对应一和两样本t检验),2个或更多的F-测试。 fac如果缺少,这是一组测试(即只允许为t-检验)。因素的长度需要对应的样本大小:row*功能因子的长度必须是xcol*,列数相同功能,它必须是作为x行数相同的。如果x是一个ExpressionSet,则fac也可能是一个特征向量长度1名协在x。


参数:tstatOnly
A logical variable indicating whether to calculate p-values from the t-distribution with appropriate degrees of freedom. If TRUE, just the t-statistics are returned. This can be considerably faster.
一个逻辑变量,表示是否从t分布计算p值与适当程度的自由。如果TRUE,刚刚返回t-统计量。这可能是相当快。


参数:ig1
The indices of the columns of x that correspond to group 1.
x列指数对应1组。


参数:ig2
The indices of the columns of x that correspond to group 2.
x列指数对应2组。


参数:var.equal
A logical variable indicating whether to treat the variances in the samples as equal.  If 'TRUE', a simple F test for the equality of means in a one-way analysis of variance is performed.  If 'FALSE', an approximate method of Welch (1951) is used, which generalizes the commonly known 2-sample Welch test to the case of arbitrarily many samples.
一个逻辑变量,表示是否要平等对待样品中的差异。如果“TRUE”,一个简单的单向方差分析在平等的手段进行F检验。如果“假”,韦尔奇近似法(1951年),推广俗称韦尔奇样品测试任意多个样品的情况下的。


Details

详情----------Details----------

If fac is specified, rowttests performs for each row of x a two-sided, two-class t-test with equal variances. fac must be a factor of length ncol(x) with two levels, corresponding to the two groups. The sign of the resulting t-statistic corresponds to "group 1 minus group 2". If fac is missing, rowttests performs for each row of x a two-sided one-class t-test against the null hypothesis 'mean=0'.
如果fac指定rowttestsx双面,方差相等的两个类T-测试的每一行执行。 fac必须是一个长度的因素ncol(x)两个级别,相应的两组。所产生的t-统计的符号对应“组1负2组”。 fac如果丢失,rowttestsx一类对零假设的双面T-测试“平均= 0的每一行执行。

rowttests and colttests are implemented in C and should be reasonably fast and memory-efficient. fastT is an alternative implementation, in Fortran, possibly useful for certain legacy code. rowFtests and colFtests are currently implemented using matrix algebra in R. Compared to the rowttests and colttests functions, they are slower and use more memory.
rowttests和colttestsC和实施,应该是合理的速度和记忆体效率。 fastT是一个替代的实施,在Fortran,可能是有用的某些遗留代码。 rowFtests和colFtests目前正在实施的R中使用矩阵代数rowttests和colttests功能相比,他们是慢,使用更多的内存。


值----------Value----------

A data.frame with columns statistic, p.value (optional in the case of the t-test functions) and dm, the difference of the group means (only in the case of the t-test functions). The row.names of the data.frame are taken from the corresponding dimension names of x.
一个data.frame列statistic,p.value(可选t检验功能的情况下)和dm,该组的差异意味着(只在t-检验功能)。采取相应的维度名称从row.names的x数据框。

The degrees of freedom are provided in the attribute df. For the F-tests, if var.equal is 'FALSE', nrow(x)+1 degree of freedoms  are given, the first one is the first degree of freedom (it is the same for each row) and the other ones are the second degree of freedom (one for each row).
属性df提供的自由度。为F-测试,如果var.equal是假,nrow(x)+1自由度,第一个是第一自由度(这是每行相同)和其他的是的第二自由度(每行一个)。


作者(S)----------Author(s)----------


Wolfgang Huber <whuber@embl.de>



参考文献----------References----------



参见----------See Also----------

mt.teststat
mt.teststat


举例----------Examples----------


   ##[#]
   ## example data[#示例数据]
   ##[#]
   x  = matrix(runif(40), nrow=4, ncol=10)
   f2 = factor(floor(runif(ncol(x))*2))
   f4 = factor(floor(runif(ncol(x))*4))

   ##[#]
   ## one- and two group row t-test; 4-group F-test[4 F组测试#一,二组行t检验;]
   ##[#]
   r1 = rowttests(x)
   r2 = rowttests(x, f2)
   r4 = rowFtests(x, f4)

   ## approximate equality[#近似相等]
   about.equal = function(x,y,tol=1e-10)
     stopifnot(is.numeric(x), is.numeric(y), length(x)==length(y), all(abs(x-y) < tol))

   ##[#]
   ## compare with the implementation in t.test[#比较与在t.test的实施]
   ##[#]
   for (j in 1:nrow(x)) {
     s1 = t.test(x[j,])
     about.equal(s1$statistic, r1$statistic[j])
     about.equal(s1$p.value,   r1$p.value[j])

     s2 = t.test(x[j,] ~ f2, var.equal=TRUE)
     about.equal(s2$statistic, r2$statistic[j])
     about.equal(s2$p.value,   r2$p.value[j])

     dm = -diff(tapply(x[j,], f2, mean))
     about.equal(dm, r2$dm[j])

     s4 = summary(lm(x[j,] ~ f4))
     about.equal(s4$fstatistic["value"], r4$statistic[j])
   }

   ##[#]
   ## colttests[#colttests]
   ##[#]
   c2 = colttests(t(x), f2)
   stopifnot(identical(r2, c2))

   ##[#]
   ## missing values[#遗漏值]
   ##[#]
   f2n = f2
   f2n[sample(length(f2n), 3)] = NA
   r2n = rowttests(x, f2n)
   for(j in 1:nrow(x)) {
     s2n = t.test(x[j,] ~ f2n, var.equal=TRUE)
     about.equal(s2n$statistic, r2n$statistic[j])
     about.equal(s2n$p.value,   r2n$p.value[j])
   }

   ##[#]
   ## larger sample size[#更大的样本大小]
   ##[#]
   x  = matrix(runif(1000000), nrow=4, ncol=250000)
   f2 = factor(floor(runif(ncol(x))*2))
   r2 = rowttests(x, f2)
   for (j in 1:nrow(x)) {
     s2 = t.test(x[j,] ~ f2, var.equal=TRUE)
     about.equal(s2$statistic, r2$statistic[j])
     about.equal(s2$p.value,   r2$p.value[j])
   }

   ## single row matrix[#单列矩阵]
   rowFtests(matrix(runif(10),1,10),as.factor(c(rep(1,5),rep(2,5))))
   rowttests(matrix(runif(10),1,10),as.factor(c(rep(1,5),rep(2,5))))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-8 00:45 , Processed in 0.026018 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表