Learn R Programming

NADA2 (version 1.0.1)

cenCompareQQ: Censored Q-Q Plot comparison

Description

Produces three quantile-quantile (Q-Q) plots, also called probability plots, based on three distributions (normal, lognormal and gamma distributions).

Usage

cenCompareQQ(y.var, cen.var, Yname = yname, printrslt = TRUE)

Arguments

y.var

The column of y (response variable) values plus detection limits

cen.var

The column of indicators, where 1 (or TRUE) indicates a detection limit in the y.var column, and 0 (or FALSE) indicates a detected value in y.var.

Yname

Optional <U+2013> input text in quotes to be used as the variable name on all plots. The default Yname is the name of the y.var input variable.

printrslt

Logical TRUE/FALSE option of whether to print the best distribution in the console window, or not. Default is TRUE.

Value

Plots three Q-Q plots based on normal, lognormal and gamma distributions and prints the best-fit distribution.

Details

Produces three Q-Q plots and reports which one has the highest Shapiro-Francia test statistic (W). The distribution with the highest W is the best fit of the three.

References

Helsel, D.R., 2011. Statistics for censored environmental data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.

Millard, S.P., 2013. EnvStats: An R Package for Environmental Statistics. Springer-Verlag, New York.

Shapiro, S.S., Francia, R.S., 1972. An approximate analysis of variance test for normality. Journal of the American Statistical Association 67, 215<U+2013>216.

Examples

Run this code
# NOT RUN {
data(Brumbaugh)

cenCompareQQ(Brumbaugh$Hg,Brumbaugh$HgCen)
# }

Run the code above in your browser using DataLab