binning(sm)
binning()所属R语言包:sm
Construct frequency table from raw data
建设从原始数据频率表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a vector or a matrix x, this function constructs a frequency table associated to appropriate intervals covering the range of x.
鉴于矢量或矩阵x,这个函数构造相关联的覆盖范围内的x的适当的时间间隔的频率表。
用法----------Usage----------
binning(x, y, breaks, nbins)
参数----------Arguments----------
参数:x, y
a vector or a matrix with either one or two columns. If x is a one-dimentional matrix, this is equivalent to a vector.
与任一列或两列的矢量或矩阵。如果x是一个一维的矩阵,这是相当于一个向量。
参数:breaks
either a vector or a matrix with two columns (depending on the dimension of x), assigning the division points of the axis, or the axes in the matrix case. It must not include Inf,-Inf or NAs, and it must span the whole range of the x points. If breaks is not given, it is computed by dividing the range of x into nbins intervals for each of the axes.
向量或矩阵与两列(取决于尺寸x),分配的分割点的轴,或在基体中的轴的情况下。它必须不包括Inf,-Inf或NA的,并且它必须跨越整个范围内的x点。 breaks如果没有给出,它的计算方法是将范围内的x到nbins的时间间隔为每个轴。
参数:nbins
the number of intervals on the x axis (in the vector case), or a vector of two elements with the number of intervals on each axes of x (in the matrix case). If nbins is not given, a value is computed as round(log(length(x))/log(2)+1) or using a similar expression in the matrix case. </table>
x轴线(向量中的情况下),或一个向量的两个元素与x(在矩阵的情况下)在每个轴的间隔的数目上的间隔的数目。 nbins如果没有给出一个值计算round(log(length(x))/log(2)+1)或矩阵中的情况下,使用类似的表达。 </ TABLE>
Details
详细信息----------Details----------
This function is called automatically (under the default settings) by some of the functions of the sm library when the sample size is large, to allow handling of datasets of essentially unlimited size. Specifically, it is used by sm.density, sm.regression, sm.ancova, sm.binomial and sm.poisson.
此功能称为自动(默认设置下)当样本大小是大一些sm库的功能,以允许处理的数据集的大小基本上是无限的。具体来说,它是由sm.density,sm.regression,sm.ancova,sm.binomial和sm.poisson。
值----------Value----------
In the vector case, a list is returned containing the following elements: a vector x of the midpoints of the bins excluding those with 0 frequecies, its associated matrix x.freq of frequencies, the coodinateds of the midpoints, the division points, and the complete vector of observed frequencies freq.table (including the 0 frequencies), and the vector breaks of division points. In the matrix case, the returned value is a list with the following elements: a two-dimensional matrix x with the coordinates of the midpoints of the two-dimensional bins excluding those with 0 frequecies, its associated matrix x.freq of frequencies, the coordinates of the midpoints, the matrix breaks of division points, and the observed frequencies freq.table in full tabular form.
在向量中的情况下,则返回一个列表包含以下元件:一个向量x的桶不含那些有0 frequecies,其关联矩阵的中点x.freq的频率,coodinatedsmidpoints,分割点,观察到的频率的和完整的矢量freq.table(包括0的频率),和矢量breaks分割点。在矩阵的情况下,返回值是一个包含下列元素的列表:一个二维矩阵x与不包括有0 frequecies二维箱的中点的坐标,其关联矩阵<X >的频率,的坐标x.freq,矩阵midpoints的分割点,并且所观察到的频率breaks在完整表格形式。
参考文献----------References----------
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.
参见----------See Also----------
sm, sm.density, sm.regression, sm.binomial, sm.poisson, cut, table
sm,sm.density,sm.regression,sm.binomial,sm.poisson,cut,table
实例----------Examples----------
# example of 1-d use[例如1-D使用]
x <- rnorm(1000)
xb <- binning(x)
xb <- binning(x, breaks=seq(-4,4,by=0.5))
# example of 2-d use[例如使用2-D]
x <- rnorm(1000)
y <- 2*x + 0.5*rnorm(1000)
x <- cbind(x, y)
xb<- binning(x, nbins=12)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|