Learn R Programming

survivALL (version 0.9.3)

removeOutliers: Calculate outliers in a numeric vector and then convert those values to NA

Description

Calculate outliers in a numeric vector and then convert those values to NA

Usage

removeOutliers(x, tolerant = TRUE)

Arguments

x

A numeric vector

tolerant

Outlier calculation tolerance. A more tolerant outlier removal is more appropriate when working with hazard ratios

Value

The modified, outlier removed, equivalent of x

Examples

Run this code
# NOT RUN {
set.seed(123); x <- rnorm(100)
sum(is.na(x))
y <- removeOutliers(x)
sum(is.na(y))
# }

Run the code above in your browser using DataLab