computeContClass(scrime)
computeContClass()所属R语言包:scrime
Rowwise Contigency Tables
Rowwise Contigency表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generates a matrix containing a contingency table for each row of a matrix and a vector of class labels.
生成含有应变表的矩阵的每一行的一个矩阵和一个向量的类标签。
用法----------Usage----------
computeContClass(data, cl, n.cat)
参数----------Arguments----------
参数:data
a numeric matrix consisting of integers between 1 and n.cat. Each row of data is assumed to represent a variable, and each column to represent an observation. Missing values are not allowed. All variables must comprise the same number of levels.
一个数字矩阵之间的整数1和n.cat。的每行的数据被假定为代表一个变量,并且每一列代表一个观察。遗漏值是不允许的。所有变量都必须包含相同数量的水平。
参数:cl
a numeric vector of length ncol(data) specifying the class labels of the observations represented by the columns of data. cl must consist of integers between 1 and n.cl, where n.cl is the number of classes.
一个数值向量长度ncol(data)指定类的标签所表示的数据的列的观测。 cl必须由整数1至n.cl,其中n.cl的班级数目。
参数:n.cat
an integer giving the number of levels the variables can take. If not specified, n.cat will be determined automatically. It is highly recommended not to specify n.cat.
给予的级别数的整数的变量可以采取。如果未指定,n.cat将自动确定。这是强烈建议不指定n.cat的。
值----------Value----------
A list composed of the following two matrices: <table summary="R valueblock"> <tr valign="top"><td>mat.obs</td> <td> a matrix consisting of m rows and n.cat * n.cl columns, where m is the number of variables, i.e.\ the number of rows of data. Each row of data shows the contingency table of cl and the corresponding row of data.</td></tr> <tr valign="top"><td>mat.exp</td> <td> a matrix of the same size as mat.obs containing the numbers of observations expected under the null hypothesis of equal distribution in all classes that correspond to the respective entries in mat.obs.</td></tr> </table>
以下两个矩阵组成的列表:表summary="R valueblock"> <tr valign="top"> <TD> mat.obs</ TD> <td>一个矩阵组成的m行和n.cat* n.cl列,其中m的变量数,即\行的data。每行数据显示的列联表的cl和相应的行data。</ TD> </ TR> <tr valign="top"> <TD>mat.exp< /运输署“<td>的矩阵的大小相同mat.obs含有预计相等分布的零假设下的观测对应在mat.obs。</运输署的相应条目中的所有类的数字> </ TR> </ TABLE>
(作者)----------Author(s)----------
Holger Schwender, <a href="mailto:holger.schwender@udo.edu">holger.schwender@udo.edu</a>
参考文献----------References----------
Schwender, H.\ (2007). A Note on the Simultaneous Computation of Thousands of Pearson's <code>ChiSquare</code>-Statistics. Technical Report, SFB 475, Deparment of Statistics, University of Dortmund.
参见----------See Also----------
computeContCells, rowChisqStats
computeContCells,rowChisqStats
实例----------Examples----------
# Generate an example data set consisting of 10 rows (variables)[生成的示例数据集由10行(变量)]
# and 200 columns (observations) by randomly drawing integers [列和200列(观察)随机抽取整数]
# between 1 and 3, and a vector of class labels of length 200[在1和3之间,和一个向量的长度为200的类标记]
# indicating that the first 100 observation belong to class 1[表明第100观察属于1类]
# and the other 100 to class 2. [和其他100至2级。]
mat <- matrix(sample(3, 2000, TRUE), 10)
cl <- rep(1:2, e = 100)
# Applying computeContClass to this data set[将computeContClass这组数据]
out <- computeContClass(mat, cl)
# generates the observed numbers of observations[产生所观察到的观测]
out$mat.obs
# and the corresponding expected numbers of observations.[和相应的预期数字的观察。]
out$mat.exp
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|