Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gap

Tukey's Gapping


Description

This function finds unusual spaces or gaps in a vector of random samples

Usage

gap(x = NULL)

Arguments

x

vector of values

Details

Values (x) are sorted from smallest to largest. Then Z values are calculated as follows: Zn-i+1=[i*(n-i)(Xn-i+1 - Xn-i)]^0.5

where n is the sample size

for i = 2,...,n calulate the 25 percent trimmed mean and divide into Z. This standardizes the distribution of the weighted gaps around a middle value of one. Suspiciously large observations should correspond to large standardized weighted gaps.

Value

vector of standardized weighted gaps

Author(s)

Gary A. Nelson, Massachusetts Division of Marine Fisheries gary.nelson@mass.gov

References

Tukey, J. W. 1971. Exploratory data analysis. Addison-Wesley, Reading, MA. 431 pp.

Examples

y<-c(rnorm(10,10,2),1000)
 gap(y)

fishmethods

Fishery Science Methods and Models

v1.11-1
GPL (>= 2)
Authors
Gary A. Nelson <gary.nelson@mass.gov>
Initial release
2019-12-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.