plotdist {fitdistrplus} | R Documentation |
Plots an empirical distribution (non-censored data) with a theoretical one if specified.
plotdist(data,distr,para,breaks="default",discrete=FALSE,...)
data |
A numeric vector. |
distr |
A character string "name" naming a distribution for which the corresponding
density function dname , the corresponding distribution function pname and the corresponding
quantile function qname must be defined, or directly the density function.
This argument may be omitted only if para is omitted. |
para |
A named list giving the parameters of the named distribution. This argument may be
omitted only if distname is omitted. |
breaks |
If "default" the histogram is plotted with the function hist
with its default breaks definition. Else breaks is passed to the function hist .
This argument is not taken into account if discrete is TRUE . |
discrete |
If TRUE, the distribution is considered as discrete. This argument is not taken into
account if distname is defined. In this last case, the distribution is automatically assumed
discrete if and only if distname is "binom" , "nbinom" ,"geom" ,
"hyper" or "pois" . |
... |
further graphical arguments passed to other methods |
Empirical and, if specified, theoretical distributions are plotted
in density and in cdf. For continuous distributions, the function hist
is used with its default
breaks definition if breaks
is "default"
or passing breaks
as an argument if it differs
from "default"
. For continuous distribution and when a theoretical distribution is specified
by both arguments distname
and para
, Q-Q plot and P-P plot are also plotted (Cullen and Fray, 1999).
The function ppoints
is used for the Q-Q plot, to generate the set of probabilities at
which to evaluate the inverse distribution.
Marie-Laure Delignette-Muller ml.delignette@vet-lyon.fr
Cullen AC and Frey HC (1999) Probabilistic techniques in exposure assessment. Plenum Press, USA, pp. 81-159.
descdist
, hist
, plotdistcens
and ppoints
.
x1<-c(6.4,13.3,4.1,1.3,14.1,10.6,9.9,9.6,15.3,22.1,13.4, 13.2,8.4,6.3,8.9,5.2,10.9,14.4) plotdist(x1) x2<-c(rep(4,1),rep(2,3),rep(1,7),rep(0,12)) plotdist(x2,discrete=TRUE) plotdist(x2,"pois",para=list(lambda=mean(x2))) xn<-rnorm(n=100,mean=10,sd=5) plotdist(xn,"norm",para=list(mean=mean(xn),sd=sd(xn)))