ad.plot4: Plot Results of Analytical Duplicate Analyses as Ratios,...

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Function to prepare data stored in alternate forms from that expected by function ad.plot3 for its use, for further details see x in Arguments below. The data will be plotted as ratios, i.e. dup1/dup2, with logarithmic scaling relative to their means.

Usage

1
2
3
ad.plot4(x, xname = deparse(substitute(x)), if.order = FALSE, ad.tol = NULL,
        ifalt = FALSE, ldl = NULL, maxrat = NULL, if.text = FALSE,
        if.cpp = FALSE, ...)

Arguments

x

a column vector from a matrix or data frame, x[1], ..., x[2*n]. The default is that the first n members of the vector are the first measurements and the second n members are the duplicate measurements. If the measurements alternate, i.e. duplicate pair 1 measurement 1 followed by measurement 2, etc., set ifalt = TRUE.

xname

a title can be displayed with the plot and results, e.g., xname = "Cu (mg/kg)". If this field is undefined the character string for x is used as a default.

if.order

by default the analytical duplicate results are plotted in the order in which they occur in the data file, this usually corresponds to date of analysis. Alternately, setting if.order = FALSE results in the results being plotted against their means.

ad.tol

optionally a tolerance level may be provided for the maximum acceptable percent ratio between duplicates, in which case a red dotted line is added to the plot.

ifalt

set ifalt = TRUE to accommodate alternating sets of paired observations.

ldl

if the lower detection limit (ldl) of the analytical procedure is provided and falls within the range of the duplicate means it will be plotted as a vertical black dotted line. If another colour is required, e.g., red, set col = 2. See function display.lty for the range of available colours.

maxrat

optionally the maximum ratio for the plot axis, the minimum is computed as 1/maxrat, may be set. This is useful when making comparisons between elements or between measurement methods and ensures similar scaling. Otherwise maxrat is determined from the data.

if.text

if set if.text = TRUE the locator is deployed so that the ratios for estimating the 95% confidence bounds on any value may be placed on the ratio plot.

if.cpp

if set if.cpp = TRUE the ratio plot is displayed side-by-side with an Normal Cumulative Probability Plot (CPP) of the ratios. In this instance if.text is not an option.

...

any additional arguments to be passed to the plot function for titling, etc.

Details

Data may be as a single concatenated vector from a matrix or data frame as x1[1], ..., x1[n] followed by x[n+1], ..., x[2n], or alternated as x[1] and x[2] being a pair through to x[2*i+1] and x[2*i+2] for the i in 1:n duplicate pairs, see ifalt.

If the data are as n duplicate pairs, x1 and x2, use function ad.plot3.

Note

Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df.

Author(s)

Robert G. Garrett

See Also

ad.plot3, ad.plot1, ltdl.fix.df

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Make test data available
data(ad.test)
attach(ad.test)

## Plot analytical duplicate analyses as ratios in acquistion sequence
ad.plot4(Cu, ifalt = TRUE)

## Plot analytical duplicate analysis ratios against their means with
## more informative annotation
ad.plot4(Cu, "Cu (mg/kg)", ifalt = TRUE, if.order = FALSE)

## Plot analytical duplicate analysis ratios against their means with a
## CPP of the ratios and more informative annotation
ad.plot4(Cu, "Cu (mg/kg)", ifalt = TRUE, if.order = FALSE, if.cpp = TRUE)

## Detach test data
detach(ad.test)

Example output

Loading required package: MASS\nLoading required package: fastICA\n\n  Range of ratios of the 80 duplicates: 0.865 to 1.31\n  Median ratio = 0.9877 \tMAD of ratios = 0.06665 \trRSD % = 6.7\n  Mean ratio   = 1.0018 \t SD of ratios = 0.08159 \t RSD % = 8.1 \t95% CI = 0.1624\n\n  Absolute ratio difference from 1 = 0.001788 \tSE of Mean of ratios = 0.00912 \t95% CI = 0.0182\n  Mean ratio is not different from 1 at the 95% level, no bias\n\n  95% of duplicates will fall between factors of 1.16 and 0.86 times a value\n    Robust factor estimates based on the MAD are 1.13 and 0.88 \n\nWarning messages:\n1: In ad.plot4(Cu, ifalt = TRUE) : input string \'\n  \xb1 \' cannot be translated to UTF-8, is it valid in \'ANSI_X3.4-1968\'?\n2: In ad.plot4(Cu, ifalt = TRUE) : input string \'\n  \xb1 \' cannot be translated to UTF-8, is it valid in \'ANSI_X3.4-1968\'?\n\n  Range of ratios of the 80 duplicates: 0.865 to 1.31\n  Median ratio = 0.9877 \tMAD of ratios = 0.06665 \trRSD % = 6.7\n  Mean ratio   = 1.0018 \t SD of ratios = 0.08159 \t RSD % = 8.1 \t95% CI = 0.1624\n\n  Absolute ratio difference from 1 = 0.001788 \tSE of Mean of ratios = 0.00912 \t95% CI = 0.0182\n  Mean ratio is not different from 1 at the 95% level, no bias\n\n  95% of duplicates will fall between factors of 1.16 and 0.86 times a value\n    Robust factor estimates based on the MAD are 1.13 and 0.88 \n\n\n  Range of ratios of the 80 duplicates: 0.865 to 1.31\n  Median ratio = 0.9877 \tMAD of ratios = 0.06665 \trRSD % = 6.7\n  Mean ratio   = 1.0018 \t SD of ratios = 0.08159 \t RSD % = 8.1 \t95% CI = 0.1624\n\n  Absolute ratio difference from 1 = 0.001788 \tSE of Mean of ratios = 0.00912 \t95% CI = 0.0182\n  Mean ratio is not different from 1 at the 95% level, no bias\n\nWarning messages:\n1: In par(old.par) : graphical parameter "cin" cannot be set\n2: In par(old.par) : graphical parameter "cra" cannot be set\n3: In par(old.par) : graphical parameter "csi" cannot be set\n4: In par(old.par) : graphical parameter "cxy" cannot be set\n5: In par(old.par) : graphical parameter "din" cannot be set\n6: In par(old.par) : graphical parameter "page" cannot be set\nsh: 1: rm: Permission denied\n

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to ad.plot4 in rgr...