Scatter plot of observations for a pair of devices with calibration curve.

Share:

Description

Creates a scatter plot for any pair of observations in the data.frame and superimposes the calibration curve.

Usage

1
cplot(df, i, j, leg.loc="topleft", regress=FALSE, lw=1, t.size=1, alpha.beta.sigma=NULL)

Arguments

df

n (no. of items) x N (no. of methods) matrix or data.frame containing the measurements. N must be >= 3 and n > N.

i

Select column i for device i.

j

Select column j for device j not equal to i.

leg.loc

Location of the legend.

regress

If TRUE, add both naive regression lines (for comparison only).

lw

Line widths.

t.size

Text size.

alpha.beta.sigma

By default, cplot computes the bias (alpha, beta) and imprecision (sigma) estimates using ncb.od. You can override this by specifying a 3 x 2 matrix of values with alpha on the first row, beta on the second row, and sigma on the third row, in the same order as devices i and j.

Details

By default, cplot displays the corresponding calibration curve for devices i and j based on the parameter estimates for alpha, beta, and sigma computed using ncb.od. You can overide this calibration curve by providing argument alpha.beta.sigma with different estimates. Both naive regression lines (device i regressed on device j, and device j regressed on device i) by setting "regress=TRUE". Note, however, that the calibration curve will fall somewhere between these two regression lines, depending on the the ratio of the imprecision standard deviations (sigma's).

Value

Produces a scatter plot with the calibration curve and titles that includes the calibration equation and the scale-bias adjusted imprecision standard deviations.

Author(s)

Richard A. Bilonick

References

Jaech, J. L. (1985) Statistical Analysis of Measurement Errors. New York: Wiley.

See Also

merror.pairs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(pm2.5)

# Make various calibration plots for pm2.5 measurements
par(mfrow=c(2,2))
cplot(pm2.5,2,1)
cplot(pm2.5,3,1)
cplot(pm2.5,4,1)
# Add the naive regression lines JUST for comparison
cplot(pm2.5,5,1,regress=TRUE,t.size=0.9)

# This is redundant but illustrates using the
# argument alpha.beta.sigma
a <- ncb.od(pm2.5)$sigma.table$alpha.ncb[1:5]
b <- ncb.od(pm2.5)$sigma.table$beta[1:5]
s <- ncb.od(pm2.5)$sigma.table$sigma[1:5]

alpha.beta.sigma <- t(data.frame(a,b,s))

cplot(pm2.5,2,1,alpha.beta.sigma=alpha.beta.sigma)
cplot(pm2.5,2,1,alpha.beta.sigma=alpha.beta.sigma,regress=TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.