Learn R Programming

FIACH (version 0.1.2)

badData: Identifies spurious observations

Description

This function identifies spurious observations using a mix of stochastic and deterministic thresholds.

Usage

badData(X, meds=NULL, mads=NULL, nMads=1.96, t=0)

Arguments

X
X must be a numeric matrix.
meds
Vector containing column center. If NULL will calculate the median.
mads
Vector containing column variability. If NULL will calculate the Median Absolute Deviation.
nMads
The stochastic threshold specified in terms of MADs
t
The deterministic threshold. Specified in percentage distance from median.

Value

Returns a matrix with NaN where data was identified as spurious

Examples

Run this code
x<-rnorm(100)
x[20]<-30
badData(x)

Run the code above in your browser using DataLab