misclass(simex)
misclass()所属R语言包:simex
Generates misclassified data
产生错误分类的数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Takes a data.frame and produces misclassified data. Probabilities for the missclassification are given in the mc.matrix.
需要一个data.frame和产生错误分类的数据。概率给出为missclassification的在mc.matrix。
用法----------Usage----------
misclass(data.org, mc.matrix, k)
参数----------Arguments----------
参数:data.org
data.frame containing the factor variables. Must be factors
data.frame含有该因子变量。必须是factor的
参数:mc.matrix
a list of matrices giving the probabilities for the misclassification. Names of the list must correspond to the variable names in data.org. The colnames must be named according to the factor levels
list给误判的概率矩阵。名称list必须对应的变量名data.org。必须命名为colnames根据因子水平
参数:k
the exponent for the misclassification matrix
误判矩阵的指数
值----------Value----------
A data.frame containing the misclassified variables
Adata.frame包含错误分类变量
(作者)----------Author(s)----------
Wolfgang Lederer, <a href="mailto:wolfgang.lederer@googlemail.com">wolfgang.lederer@googlemail.com</a>
参见----------See Also----------
mcsimex, build.mc.matrix,
mcsimex,build.mc.matrix,
实例----------Examples----------
x1 <- factor(rbinom(100, 1, 0.5))
x2 <- factor(rbinom(100, 2, 0.5))
p1 <- matrix(c(1, 0, 0, 1), nrow = 2)
p2 <- matrix(c(0.8, 0.1, 0.1, 0.1, 0.8, 0.1, 0.1, 0.1, 0.8), nrow = 3)
colnames(p1) <- levels(x1)
colnames(p2) <- levels(x2)
x <- data.frame(x1 = x1, x2 = x2)
mc.matrix <- list(x1 = p1, x2 = p2)
x.mc <- misclass(data.org = x, mc.matrix = mc.matrix, k = 1)
identical(x[, 1], x.mc[, 1]) # TRUE[TRUE]
identical(x[, 2], x.mc[, 2]) # FALSE[FALSE]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|