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

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

[复制链接]
发表于 2012-10-1 16:46:17 | 显示全部楼层 |阅读模式
waffect(waffect)
waffect()所属R语言包:waffect

                                         Simulation of phenotypes in the binary (case/control) and multiclass cases.
                                         模拟二进制文件中的表型(件/控制)和多类情况。

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

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

This is the main function of the waffect package. Given a vector (matrix) of probabilities and the desired total number of cases and controls (resp.: individuals in each class) waffect outputs a simulated phenotypic dataset.
这是waffect包的主要功能。给定一个向量(矩阵)的概率和所需的病例组和对照组的总人数(或个人在每类)waffect输出模拟表型数据。


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


waffect(prob, count, label, method, burnin)       



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

参数:prob
a vector of probabilities corresponding to the disease model H1: the i-th entry is the probability that the i-th individual is a  case. Alternatively, a matrix with k rows and n columns where K = number of classes and n = total number of individuals. In this case, the entry in the k-th row and j-th column is the probability that the phenotype of the j-th individual is in the k-th class. If prob is missing and count is a vector of length 2, then the constant vector of probabilities rep(0.1, sum(count)) is assumed, thus resulting in simulating phenotypes under the null  hypothesis H0. If prob is missing and count  is a vector with length greater or equal than 3, then for each individual the probability to be in the first class is 0.1 and the probability to be in each of the other classes is 0.9/(K-1).  
概率对应的病模型H1:第i个条目是一个向量的第i个个体的情况下的概率。可替换地,与k行和n列的矩阵,其中,K =数量的类和n =个体总数。在这种情况下,在第k行和第j列中的条目的第j个个体的表型是在第k个类的概率。如果prob失踪和count是一个向量,长度为2,然后不断矢量的概率rep(0.1, sum(count))假定,从而导致在模拟的原假设H0下的表型。如果prob失踪和count是一个向量,其长度大于或等于3,然后对每一个人是在第一类中的概率为0.1的概率是在每一个其他类是0.9 /(K-1)。


参数:count
either an integer (the total number of cases), or a vector of length two (number of cases and number of controls), or, in the multiclass case, a vector of length greater or equal than 3 (number of individuals in each class).
是一个整数(总数的情况下),或一个矢量的长度为2(例和数量的控件的数量),或者,在多类的情况下,一个向量的长度大于或等于3(在每个类中的个人数)。


参数:label
a list with either the labels for cases and controls or, in the multiclass case, the codes for each class. In the binary case  the first entry must be the label for cases. By default label = c(1,0) in the binary case and label = 1:K, where K is the total number of classes.
与病例组和对照组的标签,或在多类的情况下,每个类的代码的列表。在二进制的情况下,必须是标签的情况下的第一个条目。默认情况下label = c(1,0)在二进制的情况下,label = 1:K,其中K是总人数的类。


参数:method
the method to be implemented for the simulation. Three methods are available: "backward", "mcmc",  "reject". The default method is "backward"; "reject" is deprecated.
该方法被用于模拟实施。有三种方法可供选择:"backward","mcmc","reject"。默认的方法是"backward""reject"已过时。


参数:burnin
the burn-in step if method is "reject"; by default burnin = 1e+05 * n, where n is the total number of individuals.
烧伤的步骤,如果方法是"reject";默认情况下,burnin = 1e+05 * n,其中n是个人的总数。


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


参数:  
A list of phenotypes coded by the entries in label.
表型编码列表中的条目label。


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

Package documentation: waffect-package. Useful information can be also found in the vignette: vignette("waffect-tutorial").
包文件:waffect-package。有用的信息也可以被发现的小插曲:vignette("waffect-tutorial")。


实例----------Examples----------


## Not run: Typical usage to simulate case/control phenotypes under H1 (in this example: 12 individuals, 7 cases, 5 controls, the probability that individual 1 is a case is 0.2...):[#不运行:模拟病例/对照表型下H1(在这个例子中:12个人,其中7例,5控制,那个人就是一个例子是0.2的概率)的典型用法:]
waffect(prob =  c(0.2, 0.4, 0.9, 0.6, 0.9, 0.1, 0.4, 0.6, 0.6, 0.3, 0.8, 0.1), count=c(7,5), label=c(1,0))

## Not run: By rerunning the command we obtain another simulation:[#不运行:重新运行该命令时,我们得到另一个模拟:]
waffect(prob =  c(0.2, 0.4, 0.9, 0.6, 0.9, 0.1, 0.4, 0.6, 0.6, 0.3, 0.8, 0.1), count=c(7,5), label=c(1,0))

## Not run: We can just specify the number of cases:[#未运行的情况下,我们可以只指定数:]
waffect(prob =  c(0.2, 0.4, 0.9, 0.6, 0.9, 0.1, 0.4, 0.6, 0.6, 0.3, 0.8, 0.1), count=7, label=c(1,0))

## Not run: It is possible to change the default code for cases and controls:[#不运行:病例组和对照组,这是可以改变的默认代码:]
pi <- runif(100)
waffect(prob = pi, c(50,50), label = c("case","control"))

## Not run: If prob is not specified then a constant vector of probabilities is assumed by default. This is equivalent to simulate phenotypes under the null hypothesis H0:[#未运行:如果没有指定,那么概率是恒定的概率向量,则默认情况下。这是相当于模拟表型根据零假设H0:]
waffect(count = c(20,30), label=c(1,0))  

## Not run: Example with 6 individuals and 3 classes:[#不运行:有6个人,3类的实例:]
pi1 = c(0.3,0.4,0.3)
pi2 = c(0.3,0.5,0.2)
pi3 = c(0.1,0.2,0.7)
pi4 = c(0.1,0.6,0.3)
pi5 = c(0.1,0.7,0.2)
pi6 = c(0.4,0.1,0.5)
pi = cbind(pi1,pi2,pi3,pi4,pi5,pi6)
waffect(prob = pi, count = c(1,2,3))


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 23:35 , Processed in 0.022211 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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