Produces a Duewer concordance/apparent precision plot, showing relative precision or uncertainty plotted against (relative) deviation from assigned value.
dplot(x, …)duewer.plot(x, …)
# S3 method for default
duewer.plot(x,s,mu=median(x),sigma=mad(x), s0=median(s), labels=NA,
radius=1:3, units=c("z","x"),
main, xlab, ylab, xlim, ylim,
at.xax=NULL, at.yax=NULL, aspect,
col.contours="lightgrey", lty.contours=par("lty"), lwd.contours=par("lwd"),
label.contours=T, format.clab="p=%4.3f",
cex=par("cex"), cex.label=0.7, pos=3, adj=NULL,
pos.clab="bottomright", col.clab=col.contours,
cex.axis=par("cex.axis"), pch=par("pch"), las=par("las"),
col=par("col"), bg=par("bg"), …)
Numeric vector of values to be plotted.
Numeric vector of standard deviations, standard errors or uncertainties
of length length(x)
associated with x.
A single location against which to compare x.
A measure of dispersion against which deviations x-mu can be compared.
A typical, expected or reference value for the standard uncertainties s
An optional vector of point labels of length length(x)
.
labels
are coerced to character on use, so may be character, factor etc..
A vector of radii for reference lines in the classic Duewer plot.
Controls scaling of the plot. If set to "z"
, a classic Duewer plot
of s/s0
vs. (x-mu)/sigma
is produced. If units=="x"
, the plot is
drawn without scaling by sigma
or s0
.
Main title for the plot, passed to title()
.
x- and y-axis labels, passed to title()
.
x- and y-limits for the plot.
Locations for x- and yaxis tick marks, passed to axis()
The aspect ratio for the plot, passed to plot.window
. This defaults to 1.0 for
basis=="radius"
, giving semicircular countours, and NA otherwise.
Colour, line type and line width for contour lines.
Logical, controlling whether countour lines are labelled with approximate probabilities.
format string for contour labels; passed to sprintf
.
Expansion factor for plotted symbols.
Expansion factor for point labels.
Specifies position/adjustment of point labels. Passed to text
.
Specification for location of contour labels. Options are '"top"', '"topright"', '"right"',
'"bottomright"', '"bottom"', '"bottomleft"', '"left"', '"topleft"'. A vector can be provided
to give multiple labels. Contour labels for basis="prob"
are placed approximately
at the location indicated and adjusted outward appropriately. For basis="radius",
"bottomright" and "bottomleft" are as for "right" and "left" but just below the x-axis,
and "bottom" is replaced with c("bottomright", "bottomleft").
Colour for contour labels.
Expansion factor for axis labels.
Axis label orientation, passed to axis
.
Graphical parameters passed to points
.
Other parameters passed to plotting functions. Currently unused.
This function is called for its side effect, which is the production of a plot.
A Duewer plot is a plot of dispersion against location. Classically, this has been applied to
multiple observations from laboratories. Locations x
are mean results of the form
(x-mu)/s
and and dispersions s
are the associated sd. The principle has also
been applied to multiple results for different measurands per laboratory, by calculating
z-scores for all observations relative to the assigned value and dispersion for each measurand
and then plotting mean and sd of the scores. More recently the plot has been used to summarise
reported values and (usually) standard uncertainties in metrology comparisons to allow
quick assessment of anomalies within data sets.
The traditional plot includes visual guides in the form of semicircular contours at multiples of (x-mu)/sigma for the x-axis and s/s0 for the y-axis, s0 being a median or other estimate of the typical standard deviation.
Contours are, by default, labelled with probabilities corresponding to quantiles of the normal distribution.
dplot
is an alias for duewer.plot
.
Duewer, D, Probably in Anal. Chem. in about 1990
axis
for axis control, points
, text
for
plotting parameters; sprintf
for contour label format.
xs.plot
for a plot of location and scale data with probabilistic
confidence regions.
# NOT RUN {
require(metRology)
data(Pb)
Pb
duewer.plot(Pb$value, Pb$u)
duewer.plot(Pb$value, Pb$u, basis="prob", df=5)
#Illustrate contour labelling
duewer.plot(Pb$value, Pb$u, pos.clab="bottom")
# }
Run the code above in your browser using DataLab