get_head_outliers: Detect Hydraulic Head Outliers

View source: R/get_head_outliers.R

get_head_outliersR Documentation

Detect Hydraulic Head Outliers

Description

Detect outliers in the fluid pressure data by comparing parameter values against statistical metrics derived from the heads dataset. This function will employ both the standard score (z-score) and Interquartile Range (IQR) methods for outlier identification.

Usage

get_head_outliers(
  data = mlms::heads,
  vars = NULL,
  method = c("z-score", "IQR"),
  threshold = 3,
  multiplier = 1.5,
  min_n = 10L,
  quiet = TRUE
)

Arguments

data

'data.frame' table. Depth-discrete measurements of fluid pressure and temperature, hydraulic head values, and land-surface atmospheric pressure measurements. Defaults to the heads dataset.

vars

'character' vector. One or more variable names for which to compute summary statistics. Choices include: "total_head_va" is the hydraulic head in feet above the North American Vertical Datum of 1988, "temp_va" is the fluid temperature in degree Celsius, "baro_va" is the atmospheric pressure in pounds per square inch absolute (psi), and "press_va" is the absolute fluid pressure in psi. By default, all variables are included.

method

'character' string. Outlier detection method. Specify "z-score" (default) for the standard score method, best suited for normally distributed data, or "IQR" to use the IQR method, which is ideal for skewed distributions.

threshold

'numeric' number. Z-score value used to determine whether a parameter value is considered an outlier or significantly different from the historic mean value.

multiplier

'numeric' number. Multiplier used to determine the threshold for outliers in the IQR method.

min_n

'integer' number. Minimum sample size needed to detect outliers.

quiet

'logical' flag. Whether to suppress printing of outlier information.

Value

A data frame with the following variables:

var_ds

Variable description.

var_nm

Variable name as specified in the vars argument.

site_nm

Local site name for a MLMS well.

port_nu

Identifier for the valved measurement port, included only if the by_port argument is set to true (not the default).

press_dt

Time at which measurements were measured outside the multiport casing.

var_va

Parameter value.

z_score

Z-score, a statistical measure that indicates how many standard deviations a parameter value is from the mean.

qu_1st

First quartile (25th percentile) of historical parameter values.

qu_3rd

Third quartile (75th percentile) of historical parameter values.

n

Sample size.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

get_head_stats function is used to calculate the fluid pressure statistics.

Examples

d <- get_head_outliers()
str(d)

d <- get_head_outliers(method = "IQR")
str(d)

mlms documentation built on April 4, 2025, 4:43 a.m.