cdfPlot(distribution = "norm", param.list = list(mean = 0, sd = 1),
left.tail.cutoff = ifelse(is.finite(supp.min), 0, 0.001),
right.tail.cutoff = ifelse(is.finite(supp.max), 0, 0.001), plot.it = TRUE,
add = FALSE, n.points = 1000, cdf.col = "black", cdf.lwd = 3 * par("cex"),
cdf.lty = 1, curve.fill = FALSE, curve.fill.col = "cyan",
digits = .Options$digits, ..., type = ifelse(discrete, "s", "l"),
main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL)
distribution="norm"
. See the help file for Distribution.df
for a
list of possible distribution param.list=list(mean=0, sd=1)
. See the help file for
Distribution.df
for the names and possible0
0
; foadd
) on the current graphics device. If plot.it=FALSE
, no
plot is produced, but a list of $(x, y)$ values is returned (see the sectionadd=TRUE
), or to create a new plot
(add=FALSE
; the default). This argument is ignored if plot.it=FALSE
n.points=1000
.pdf.col="black"
. See the entry for col
in the
help file for par
pdf.lwd=3*par("cex")
.
See the entry for lwd
in the help file for par
for morepdf.lty=1
. See the entry for
lty
in the help file for par
for more informatiocurve.fill.col
. The default value is curve.fill=FALSE
.curve.fill=TRUE
, a numeric scalar or character string
indicating what color to use to fill in the
area below the cumulative distribution function curve. The default value is
curve.fill.col="cyan"
. See the entrydigits=.Options$digits
.cdfPlot
invisibly returns a list giving coordinates of the points
that have been or would have been plotted:Distribution.df
, ecdfPlot
, cdfCompare
,
pdfPlot
.# Plot the cdf of the standard normal distribution
#-------------------------------------------------
dev.new()
cdfPlot()
#==========
# Plot the cdf of the standard normal distribution
# and a N(2, 2) distribution on the sample plot.
#-------------------------------------------------
dev.new()
cdfPlot(param.list = list(mean=2, sd=2), main = "")
cdfPlot(add = TRUE, cdf.col = "red")
legend("topleft", legend = c("N(2,2)", "N(0,1)"),
col = c("black", "red"), lwd = 3 * par("cex"))
title("CDF Plots for Two Normal Distributions")
#==========
# Clean up
#---------
graphics.off()
Run the code above in your browser using DataLab