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

R语言 genefu包 fuzzy.ttest()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 18:48:45 | 显示全部楼层 |阅读模式
fuzzy.ttest(genefu)
fuzzy.ttest()所属R语言包:genefu

                                         Function to compute the weighted mean and weighted variance of 'x'
                                         函数来计算的加权平均加权方差和X

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

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

This function allows for computing the weighted mean and weighted variance of a vector of continuous values.
此功能允许计算的加权平均和加权连续值向量的方差。


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


fuzzy.ttest(x, w1, w2, alternative=c("two.sided", "less", "greater"), na.rm = FALSE)



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

参数:x
an object containing the values whose weighted mean is to be computed.  
包含一个对象,其加权平均计算的值。


参数:w1
a numerical vector of weights of the same length as x giving the weights to use for elements of x in the first class.  
x给权使用元素数值向量的长度相同的重量x一流。


参数:w2
a numerical vector of weights of the same length as x giving the weights to use for elements of x in the second class.  
x给权使用元素数值向量的长度相同的重量x在第二类。


参数:alternative
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".  You can specify just the initial letter.  
一个字符串,指定替代假说,必须是一个的“two.sided”(默认),“大”或“少”。您可以指定只的首字母。


参数:na.rm
TRUE if missing values should be removed, FALSE otherwise.  
TRUE如果缺失值应该被删除,FALSE否则。


Details

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

The weights w1 and w2 should represent the likelihood for each observation stored in x to belong to the first and second class, respectively. Therefore the values contained in w1 and w2 should lay in [0,1] and 0 <= (w1[i] + w2[i]) <= 1 for i in {0,1,...,n} where n is the length of x.
的重量w1和w2应该代表为x属于第一和第二类,分别存储每个观察的可能性。因此,值包含在w1和w2应该奠定在[0,1]和0 <=(W1 [I] + W2 [I])<= 1,因为我在{0, 1,...,N},其中n是x的长度。

The Welch's version of the t test is implemented in this function, therefore assuming unequal sample size and unequal variance. The sample size of the first and second class are calculated as the sum(w1) and sum(w2), respectively.
韦尔奇的t检验的版本中实现此功能,因此,假设样本大小不均和不平等的方差。 sum(w1)和sum(w2),分别为第一和第二类的样本量计算。


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

A numeric vector of six values that are the difference between the two weighted means, the value of the t statistic, the sample size of class 1, the sample size of class 2, the degree of freedom and the corresponding p-value.
数字向量的六个值,两者之间的加权方式的差异,t统计值,1级,2级的样本大小,自由度和相应的p值的样本大小。


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



Benjamin Haibe-Kains




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

http://www.nicebread.de/blog/files/fc02e1635792cb0f2b3cbd1f7e6c580b-10.php

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

weighted.mean
weighted.mean


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


set.seed(54321)
## random generation of 50 normally distributed values for each of the two classes[#50值正态分布随机生成两个类]
xx <- c(rnorm(50), rnorm(50)+1)
## fuzzy membership to class 1[#模糊隶属度1级]
ww1 <- runif(50) + 0.3
ww1[ww1 > 1] <- 1
ww1 <- c(ww1, 1 - ww1)
## fuzzy membership to class 2[#模糊隶属2级]
ww2 <- 1 - ww1
## Welch's t test weighted by fuzzy membership to class 1 and 2 [加权模糊隶属度1级和2#韦尔奇的t检验]
wt <- fuzzy.ttest(x=xx, w1=ww1, w2=ww2)
print(wt)
## Not run: [#无法运行:]
## permutation test to compute the null distribution of the weighted t statistic[#置换的测试,以计算加权t统计量的零分布]
wt <- wt[2]
rands <- t(sapply(1:1000, function(x,y) { return(sample(1:y)) }, y=length(xx)))
randst <- apply(rands, 1, function(x, xx, ww1, ww2) { return(fuzzy.ttest(x=xx, w1=ww1[x], w2=ww2[x])[2]) }, xx=xx, ww1=ww1, ww2=ww2)
ifelse(wt < 0, sum(randst <= wt), sum(randst >= wt)) / length(randst)

## End(Not run)[#结束(不运行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-8 04:30 , Processed in 0.024270 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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