cdfPlot {pedometrics}R Documentation

Plot estimated cumulative distribution function with confidence limits

Description

This function is a modified version of cdf.plot() of spsurvey-package including new argument options.

Usage

cdfPlot(obj, ind, units.cdf = "percent", type.plot = "s",
  type.cdf = "continuous", logx = "", xlbl = NULL, ylbl = "Percent",
  ylbl.r = NULL, figlab = NULL, legloc = "BR", confcut = 5,
  show.conflev = TRUE, conflev = 95, show.param = TRUE, round = 0,
  col.param = "black", ...)

Arguments

obj

Object with the estimated CDF. The resulting object of cont.analysis() of spsurvey-package.

ind

Indicator variable. The name of the variable as displayed in the resulting object of cont.analysis().

units.cdf

Indicator for the type of units in which the CDF is plotted, where “percent” means the plot is in terms of percent of the population, and “units” means the plot is in terms of units of the population. Defaults to units.cdf = "percent".

type.plot

Type of plot. Desired type of plot to be produced, with options type.plot = "l", for ‘line’, and type.plot = "s" for ‘stair’. See ‘Details’. Defaults to type.plot = "s".

type.cdf

Character string consisting of the value “continuous” or “ordinal” that controls the type of CDF plot for each indicator. Defaults to type.cdf = "continuous".

logx

Character string consisting of the value "" or "x" that controls whether the x axis uses the original scale ("") or the base 10 logarithmic scale ("x"). Defaults to logx = "".

xlbl

Character string providing the x-axis label. If this argument equals NULL, then the indicator name is used as the label. Defaults to xlbl = NULL.

ylbl

Character string providing the the y-axis label. Defaults to ylbl = "Percent".

ylbl.r

Character string providing the label for the right side y-axis, where ylbl.r = NULL means a label is not created, and ylbl.r = "Same" means the label is the same as the left side label (i.e., argument ylbl). Defaults to ylbl.r = NULL.

figlab

Character string providing the plot title. Defaults to figlab = NULL.

legloc

Indicator for location of the plot legend, where legloc = "BR" means bottom right, legloc = "BL" means bottom left, legloc = "TR" means top right, and legloc = "TL" means top left. Defaults to legloc = "BR".

confcut

Numeric value that controls plotting confidence limits at the CDF extremes. Confidence limits for CDF values (percent scale) less than confcut or greater than 100 minus confcut are not plotted. A value of zero means confidence limits are plotted for the complete range of the CDF. Defaults to confcut = 5.

show.conflev

Logical for showing the confidence limits of the CDF. Defaults to show.conflev = TRUE.

conflev

Numeric value of the confidence level used for confidence limits. Defaults to conflev = 95.

show.param

Logical for showing the parameters of the CDF. Available parameters are the mean, the median, and a percentile defined by the argument conflev. The legend displays de actual values of all three parameters, including the standard deviation of the mean. The percentile value is calculated using spsurvey::interp.cdf().

round

Numeric to set the rounding level of the parameters of the CDF.

col.param

Color of the lines showing the parameters of the CDF. Defaults to col.param = "black".

...

Additional arguments passed to plot(). See ‘Details’.

Details

Parameter type.plot is used only when type.cdf = "Continuous".

Care should be taken with possible conflicts between the arguments of the original function cdf.plot and those passed to plot() using .... The existence of conflicts between these two functions was one of the reasons for creating this new implementation.

Value

A plot of the estimated cumulative distribution function with confidence limits.

Note

Most of the source code that constitutes this function was originaly published in the spsurvey-package, version 2.6 (2013-09-20). The authors were asked to include a few new functionalities, but did not seem to be interested in doing so, since no reply was obtained. This implementation is a way of including such functionalities. When using this function, credit should be given to the authors of the original implementation in the spsurvey-package.

Author(s)

Tony Olsen Olsen.Tony@epa.gov
Tom Kincaid Kincaid.Tom@epa.gov
Alessandro Samuel-Rosa alessandrosamuelrosa@gmail.com

References

Brus, D. J., Kempen, B. and Heuvelink, G. B. M. (2011). Sampling for validation of digital soil maps. European Journal of Soil Science, v. 62, p. 394-407.

Diaz-Ramos, S., D.L. Stevens, Jr., and A.R. Olsen. (1996). EMAP Statistical Methods Manual. EPA/620/R-96/XXX. Corvallis, OR: U.S. Environmental Protection Agency, Office of Research and Development, National Health Effects and Environmental Research Laboratory, Western Ecology Division.

Kincaid, T. M. and Olsen, A. R. (2013) spsurvey: Spatial Survey Design and Analysis. R package version 2.6. URL: http://www.epa.gov/nheerl/arm/.

See Also

cdf.plot.

Examples


## Not run: 
## Estimate the CDF
my.cdf <- spsurvey::cont.analysis(spsurvey.obj = my.spsurvey)

## See indicator levels in the resulting object
levels(my.cdf$Pct$Indicator)

## Plot CDF
cdfPlot(obj = my.cdf, ind = "dz", figlab = "",
   xlbl = "Difference (m)", xlim = c(-30, 10), type.plot = "s")

## End(Not run)


[Package pedometrics version 0.6-6 Index]