ecdf(stats)
ecdf()所属R语言包:stats
Empirical Cumulative Distribution Function
经验的累积分布函数
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute an empirical cumulative distribution function, with several methods for plotting, printing and computing with a such an “ecdf” object.
计算经验累积分布函数,绘图,打印和计算这样的“厄立特里亚社区发展基金”对象的几种方法。
用法----------Usage----------
ecdf(x)
## S3 method for class 'ecdf'
plot(x, ..., ylab="Fn(x)", verticals = FALSE,
col.01line = "gray70", pch = 19)
## S3 method for class 'ecdf'
print(x, digits= getOption("digits") - 2, ...)
## S3 method for class 'ecdf'
summary(object, ...)
## S3 method for class 'ecdf'
quantile(x, ...)
参数----------Arguments----------
参数:x, object
numeric vector of the observations for ecdf; for the methods, an object inheriting from class "ecdf".
数字向量的意见;ecdf的方法,对象,继承类"ecdf"。
参数:...
arguments to be passed to subsequent methods, e.g., plot.stepfun for the plot method.
参数被传递到后续方法,例如,plot.stepfunplot方法的。
参数:ylab
label for the y-axis.
为y轴的标签。
参数:verticals
see plot.stepfun.
看到plot.stepfun。
参数:col.01line
numeric or character specifying the color of the horizontal lines at y = 0 and 1, see colors.
数字或字符指定颜色的水平线在y = 0和1,看到colors。
参数:pch
plotting character.
绘制字符。
参数:digits
number of significant digits to use, see print.
有效位数的号码使用,请参阅print。
Details
详情----------Details----------
The e.c.d.f. (empirical cumulative distribution function) Fn is a step function with jumps i/n at observation values, where i is the number of tied observations at that value. Missing values are ignored.
在e.c.d.f. (经验累积分布函数)Fn是一个跳步功能i/n观测值,其中i是并列的意见,在该值。遗漏值将被忽略。
For observations x= (x1,x2, ... xn), Fn is the fraction of observations less or equal to t, i.e.,
为观察x = ( x1,x2,... xn),Fn是分数小于或等于t,即观察,
The function plot.ecdf which implements the plot method for ecdf objects, is implemented via a call to plot.stepfun; see its documentation.
的功能plot.ecdf实现plotecdf对象的方法的,是通过调用实施plot.stepfun;看到它的文件。
值----------Value----------
For ecdf, a function of class "ecdf", inheriting from the "stepfun" class, and hence inheriting a knots() method.
ecdf一类的功能"ecdf","stepfun"类继承,从而继承knots()方法,。
For the summary method, a summary of the knots of object with a "header" attribute.
summary方法,总结了object"header"属性节。
The quantile(obj, ...) method computes the same quantiles as quantile(x, ...) would where x is the original sample.
quantile(obj, ...)方法计算quantile(x, ...)相同位数会x是原始样本。
作者(S)----------Author(s)----------
Martin Maechler, <a href="mailto:maechler@stat.math.ethz.ch">maechler@stat.math.ethz.ch</a>.<br>
Corrections by R-core.
参见----------See Also----------
stepfun, the more general class of step functions, approxfun and splinefun.
stepfun,步骤职能的更一般的类,approxfun和splinefun。
举例----------Examples----------
##-- Simple didactical ecdf example :[# - 简单的教育方法厄立特里亚社区发展基金的例子:]
x <- rnorm(12)
Fn <- ecdf(x)
Fn # a *function*[*功能*]
Fn(x) # returns the percentiles for x[返回为x的百分]
tt <- seq(-2,2, by = 0.1)
12 * Fn(tt) # Fn is a 'simple' function {with values k/12}[Fn是一个“简单”的函数{值k/12}]
summary(Fn)
##--> see below for graphics[# - >见下面的图形]
knots(Fn)# the unique data values {12 of them if there were no ties}[独特的数据值{如果有没有关系,其中12}]
y <- round(rnorm(12),1); y[3] <- y[1]
Fn12 <- ecdf(y)
Fn12
knots(Fn12)# unique values (always less than 12!)[唯一值(总是小于12!)]
summary(Fn12)
summary.stepfun(Fn12)
## Advanced: What's inside the function closure?[#高级:内部封闭的功能是什么?]
print(ls.Fn12 <- ls(environment(Fn12)))
##[1] "f" "method" "n" "x" "y" "yleft" "yright"[#[1]“f”的“法”,“n”的“X”“Y”,“yleft”yright“]
utils::ls.str(environment(Fn12))
stopifnot(all.equal(quantile(Fn12), quantile(y)))
###----------------- Plotting --------------------------[#,-----------------绘制--------------------------]
require(graphics)
op <- par(mfrow=c(3,1), mgp=c(1.5, 0.8,0), mar= .1+c(3,3,2,1))
F10 <- ecdf(rnorm(10))
summary(F10)
plot(F10)
plot(F10, verticals= TRUE, do.points = FALSE)
plot(Fn12 , lwd = 2) ; mtext("lwd = 2", adj=1)
xx <- unique(sort(c(seq(-3, 2, length=201), knots(Fn12))))
lines(xx, Fn12(xx), col='blue')
abline(v=knots(Fn12),lty=2,col='gray70')
plot(xx, Fn12(xx), type='o', cex=.1)#- plot.default {ugly}[ - plot.default {丑陋}]
plot(Fn12, col.hor='red', add= TRUE) #- plot method[ - 图法]
abline(v=knots(Fn12),lty=2,col='gray70')
## luxury plot[#豪华图]
plot(Fn12, verticals=TRUE, col.points='blue',
col.hor='red', col.vert='bisque')
##-- this works too (automatic call to ecdf(.)):[# - 这个工程太(自动呼叫厄立特里亚社区发展基金()。):]
plot.ecdf(rnorm(24))
title("via simple plot.ecdf(x)", adj=1)
par(op)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|