baytrends (version 1.1.0)

rmse: Root-Mean-Squared and Relative Differences

Description

Computes the root-mean-squared error (RMSE) of the difference between observed values and the predicted values or the RMSE or relative percent differences (RPD) between samples and duplicates.

Usage

rmse(x, ...)

# S3 method for default rmse(x, y, ...)

# S3 method for lm rmse(x, ...)

rpd(x, y, plotit = FALSE)

Arguments

x

either a random vector an object for which a method exists.

arguments to be passed to or from methods.

y

duplicate samples paired with x.

plotit

logical, if TRUE, then create a Bland-Altman mean-difference plot (banld and Altman, 1986); otherwise no plot is created.

Value

For the rmse functions, a single value representing the estimated RMSE. For rpd, the relative percent differences for each paired sample and duplicate.

Details

Added from smwrStats.

References

Bland J.M. and Altman D.G., 1986 Statistical methods for assessing agreement between two methods of clinical measurement: Lancet, i, p. 307--310.

Clesceri, L.S., Greenberg, A.E., and Eaton, A.D., 1998, Standard methods for the examination of water and wastewater, 20th edition: Baltimore, Md, United Book Press, Inc., 1162 p.

Harvey, D., undated, Analytical chemistry 2.0: Analytical Sciences Digital Library: online at URL: http://www.asdlib.org/onlineArticles/ecourseware/Analytical

Helsel, D.R., and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.

Examples

Run this code
# NOT RUN {
# Example 15.2 from Harvey.
dupX1 <- c(160, 196, 207, 185, 172, 133)
dupX2 <- c(147, 202, 196, 193, 188, 119)
rmse(dupX1, dupX2)
rpd(dupX1, dupX2)

# }

Run the code above in your browser using DataLab