Learn R Programming

metRology (version 0.9-28-1)

duewer.plot: Duewer concordance/apparent precision plot

Description

Produces a Duewer concordance/apparent precision plot, showing relative precision or uncertainty plotted against (relative) deviation from assigned value.

Usage

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"), …)

Arguments

x

Numeric vector of values to be plotted.

s

Numeric vector of standard deviations, standard errors or uncertainties of length length(x) associated with x.

mu

A single location against which to compare x.

sigma

A measure of dispersion against which deviations x-mu can be compared.

s0

A typical, expected or reference value for the standard uncertainties s

labels

An optional vector of point labels of length length(x). labels are coerced to character on use, so may be character, factor etc..

radius

A vector of radii for reference lines in the classic Duewer plot.

units

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

Main title for the plot, passed to title().

xlab, ylab

x- and y-axis labels, passed to title().

xlim, ylim

x- and y-limits for the plot.

at.xax, at.yax

Locations for x- and yaxis tick marks, passed to axis()

aspect

The aspect ratio for the plot, passed to plot.window. This defaults to 1.0 for basis=="radius", giving semicircular countours, and NA otherwise.

col.contours, lty.contours, lwd.contours

Colour, line type and line width for contour lines.

label.contours

Logical, controlling whether countour lines are labelled with approximate probabilities.

format.clab

format string for contour labels; passed to sprintf.

cex

Expansion factor for plotted symbols.

cex.label

Expansion factor for point labels.

pos, adj

Specifies position/adjustment of point labels. Passed to text.

pos.clab

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").

col.clab

Colour for contour labels.

cex.axis

Expansion factor for axis labels.

las

Axis label orientation, passed to axis.

pch, col, bg

Graphical parameters passed to points.

Other parameters passed to plotting functions. Currently unused.

Value

This function is called for its side effect, which is the production of a plot.

Details

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.

References

Duewer, D, Probably in Anal. Chem. in about 1990

See Also

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.

Examples

Run this code
# 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