na.extremify: Handing Missing Values in Objects for Application of Robust...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This generic function is useful for dealing with NAs. It returns the object and replaces missing values by a vale which is very large compared to the range of values in that object. This can be reasonable if a robust estimation procedure is applied which is influenced not at all or only very little by extreme observations.

Usage

1
2
3
4
na.extremify(object, ...)

## S3 method for class 'ts'
na.extremify(object, ...)

Arguments

object

an object. Currently there is only a methods for numeric vectors.

...

currently ignored.

Details

Missing values are replaced by the value max(object) + 1e+03 * diff(range(object)) rounded up to the next power of 10.

This approach is only sensible if the proportion of missing values is lower than the breakdown point of the robust procedure which will be applied to the data afterwards. Note that all missing values are replaced by the same large value. The induced discreteness and asymmetry might cause problems for some robust estimation procedures.

Value

The object without missing values. The class of object will be preserved. If there are missing values in object, the output has attribute "na.action" which provides information on the missing values and how these have been handled.

Author(s)

Tobias Liboschik

See Also

na.action; options with argument na.action for setting NA actions.

na.fail, na.omit, na.exclude, na.pass and na.contiguous for other methods for handling missing values.

Examples

1
2
3
x <- ts(c(1, 2, 3, 4, NA, 6, 7))
na.extremify(x)
median(na.extremify(x))

robts documentation built on May 2, 2019, 4:55 p.m.