plot.compare {distfreereg} | R Documentation |
Summary and diagnostic plots for compare
objects
Description
This is a plot
method for objects of class compare
. It automates the creation of four summary and diagnostic plots for compare
objects. See the Plotting with the distfreereg
Package vignette for examples.
Usage
## S3 method for class 'compare'
plot(x, y, ..., which = "cdf", stat = NULL, hlines = NULL, curve_args = NULL,
confband_args = FALSE, density_args = NULL, poly = NULL, legend = NULL,
qqline = NULL)
Arguments
x |
Object of class |
y |
Optional object of class |
... |
Additional parameters passed to a plotting function depending on the
value of |
which |
Character string. Acceptable values are "
|
stat |
Character string, specifies the statistic to plot. |
hlines |
An optional list of arguments to pass to |
curve_args |
An optional list used to pass arguments to |
confband_args |
An optional list of values that control the calculation and plotting of confidence bands when
Setting equal to |
density_args |
An optional list of arguments passed to |
poly |
An optional list of arguments passed to |
legend |
An optional list of arguments passed to |
qqline |
An optional list of arguments passed to |
Details
This function produces a plot of a type specified by which
. The values
plotted depend on whether or not y
is present and the value of
which
. When y
is present, the plots compare the observed
statistics in x
and the observed statistics in y
. When y
is missing, the plots compare the observed and simulated statistics in
x
. (The exception is when which
is "qqp
", which is only
available when y
is missing.)
When which
is "cdf
" or "dens
", the plotting region and
associated labels, tick marks, etc., are created by an initial call to
plot
. The curves themselves are drawn with lines
.
The arguments specified in ...
are passed to the initial call to
plot
.
Value
The values used to create the curves (or points, in the case of a Q–Q plot) are returned invisibly. The details depend on the value of which
:
-
cdf
: A list with two or four elements, all lists. The first two sub-lists contain thex
- andy
-values cdf curves. If confidence bands are plotted, then two additional elements are included with output from the confidence band calculations, including elementsw
,cb_lower
, andcb_upper
, which contain, respectively, thex
-coordinates for both the upper and lower bounds of the band, they
-coordinates for the lower band, and they
-coordinates for the upper band. -
dens
: A list with two or four elements, all lists. The first two sub-lists containx
- andy
-values for the density curves. If confidence bands are plotted, then two additional sub-lists are supplied, with contents identical to what is described for "cdf
". -
qq
,qqp
: The output ofqqplot
.
For "cdf
" and "dens
", the names of the elements of the returned list depend on whether or not a value for the argument y
was supplied.
Author(s)
Jesse Miller
References
Flegal, James M. et al. Simultaneous confidence bands for (Markov chain) Monte Carlo simulations, forthcoming.