gofTestCensored, which returns
an object of class "gofCensored" when testing the goodness-of-fit of a set of
data to a distribution. Five different kinds of plots are available.
The function plot.gofCensored is automatically called by plot
when given an object of class "gofCensored".## S3 method for class 'gofCensored':
plot(x, plot.type = "Summary",
captions = list(PDFs = NULL, CDFs = NULL, QQ = NULL, MDQQ = NULL, Results = NULL),
x.labels = list(PDFs = NULL, CDFs = NULL, QQ = NULL, MDQQ = NULL),
y.labels = list(PDFs = NULL, CDFs = NULL, QQ = NULL, MDQQ = NULL),
same.window = FALSE, ask = same.window & plot.type == "All", hist.col = "cyan",
fitted.pdf.col = "black", fitted.pdf.lwd = 3 * par("cex"), fitted.pdf.lty = 1,
prob.method = "michael-schucany", plot.pos.con = 0.375, ecdf.col = "cyan",
fitted.cdf.col = "black", ecdf.lwd = 3 * par("cex"), fitted.cdf.lwd = 3 * par("cex"),
ecdf.lty = 1, fitted.cdf.lty = 2, add.line = TRUE,
digits = ifelse(plot.type == "Summary", 2, .Options$digits), test.result.font = 1,
test.result.cex = ifelse(plot.type == "Summary", 0.9, 1) * par("cex"),
test.result.mar = c(0, 0, 3, 0) + 0.1,
cex.main = ifelse(plot.type == "Summary", 1.2, 1.5) * par("cex"),
cex.axis = ifelse(plot.type == "Summary", 0.9, 1) * par("cex"),
cex.lab = ifelse(plot.type == "Summary", 0.9, 1) * par("cex"),
main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, add.om.title = TRUE,
oma = if (plot.type == "Summary" & add.om.title) c(0, 0, 4, 0) else c(0, 0, 0, 0),
om.title = NULL, om.font = 2, om.cex.main = 1.5 * par("cex"), om.line = 0, ...)"gofCensored". See gofCensored.object for details.plot.type="All", in which case all plots
will be created sequentially. The possible values of plot.type are:"PDFs", "CDFs",
"QQ", "MDQQ", and/or "Results". Each component either has
the value NULL or else it is a character string c"PDFs", "CDFs", "QQ",
and/or "MDQQ". Each component either has the value
NULL or else it is a character string containing the label for th"PDFs", "CDFs", "QQ",
and/or "MDQQ". Each component either has the value
NULL or else it is a character string containing the label for thsame.window=TRUE), or to create a new graphics
window for each separate plot (same.window=FALSE; the default).
The argument is relevdevAskNewPage, indicating
whether to prompt the user before creating a new plot within a single graphics
window. The default value is FALSEplot.type == "Summary", the default value is
digits=2, otherwise it is .Options$digits (i.e., the current
settinhist.col="cyan". See the entry for col in the Rhelp file for
fitted.pdf.col="black".
Sefitted.pdf.lwd=3*par("cex").
See the entry for lwd in the Rhelp file for parfitted.pdf.lty=1.
See the entry for lty in the Rhelp file for par for more infor"kaplan-meier" (product-limit method of Kaplan and Meier (1958)),
"modified kaplan-meier"plot.pos.con=0.375. See the help files for
ecdf.col="cyan". See the entry for col in the Rhelp file for
fitted.cdf.col="black".
See the entry for col in the Rhelp file for ecdf.lwd=3*par("cex").
See the entry for lwd in the Rhelp file for parfitted.cdf.lwd=3*par("cex").
See the entry for lwd in the Rhelp file for parecdf.lty=1.
See the entry for lty in the Rhelp file for par for more informatfitted.cdf.lty=2.
See the entry for lty in the Rhelp file for par for more inforadd.line=TRUE
and plot.type="Q-Q Plot", a 0-1 line is added to the plot.
If add.line=TRUE and plot.type="Tukey M-D Q-Q Plot", a htest.result.font=1. See the description of the
font argument in the help file for parcex to use to print out the
test results. The default value is 0.9*par("cex") when
plot.type="Summary", otherwise it is par("cex").
See the descriptionmar to use to print out the
test results. The default value is test.result.mar=c(0, 0, 3, 0)+0.1.
See the description of the mar argument in the help file for
plot.type="Summary". The default value is add.om.title=TRUE.om.title=NULL, which will result in a default title.om.font=2.cex for the outer margin title.
The default value is 1.75 * par("cex").om.line=0.5.par.plot.gofCensored invisibly returns the first argument, x.plot.gofCensored is a method for the generic function
plot for the class "gofCensored" (see
gofCensored.object).
It can be invoked by calling plot and giving it an object of
class "gofCensored" as the first argument, or by calling
plot.gofCensored directly, regardless of the class of the object given
as the first argument to plot.gofCensored.
Plots associated with the goodness-of-fit test are produced on the current graphics
device. These can be one or all of the following:
plot.type="PDFs: Observed and Fitted"). See the help files forhistandpdfPlot.Note:This kind of
plot is only available for singly-censored data.plot.type="CDFs: Observed and Fitted"). See the help file forcdfCompareCensored.plot.type="Q-Q Plot"). See the help file forqqPlotCensored.plot.type="Tukey M-D Q-Q Plot").
See the help file forqqPlotCensored.plot.type="Test Results").
See the help file forprint.gofCensored.gofTestCensored for more information.gofTestCensored, gofCensored.object,
print.gofCensored, Censored Data, plot.# Create an object of class "gofCensored", then plot the results.
#----------------------------------------------------------------
gofCensored.obj <- with(EPA.09.Ex.15.1.manganese.df,
gofTestCensored(Manganese.ppb, Censored, test = "sf"))
mode(gofCensored.obj)
#[1] "list"
class(gofCensored.obj)
#[1] "gofCensored"
# Summary plot (the default)
#---------------------------
dev.new()
plot(gofCensored.obj)
# Make your own titles for the summary plot
#------------------------------------------
dev.new()
plot(gofCensored.obj, captions = list(CDFs = "Compare CDFs",
QQ = "Q-Q Plot", Results = "Results"), om.title = "Summary")
# Just the Q-Q Plot
#------------------
dev.new()
plot(gofCensored.obj, plot.type="Q-Q")
# Make your own title for the Q-Q Plot
#-------------------------------------
dev.new()
plot(gofCensored.obj, plot.type="Q-Q", main = "Q-Q Plot")
#==========
# Clean up
#---------
rm(gofCensored.obj)
graphics.off()Run the code above in your browser using DataLab