outvalues: Find out NAs and outliers in a variable(column)

Description Usage Arguments Value Examples

View source: R/UTL.outvalues.r

Description

This function will find out missing values and outliers in a certain variable in a dataset. Outliers are defined as mean +- iqrband * interquartile range (IQR). Values exceed the min and max will also be marked as outliers.

Usage

1
outvalues(dataset, variable, iqrband=2, min=NULL, max=NULL, type=8)

Arguments

dataset

Name of the dataset

variable

Name of the variable.It should be entered as a character. For example, "BMI".

iqrband

The multiplier of IQR. Pick 3 for the very end extreme values. Pick 2 to be more inclusive

min

The smallest value that will not be determined as outliers

max

The largest value that will not be determined as outliers

type

An integer between 1 and 9 selecting one of the nine quantile algorithms detailed below to be used.

Value

This function will return a new dataset with the first column as subject/study ID and the second column as the outlying status of the input variable. Missing values will be displayed as NA. The actual values for those outliers will be displayed.

Examples

1
2
outvalues(baseline, "BMI") # default iqrband=2
outvalues(baseline, "BMI", iqrband=3, min=15, max=35, type=8)

haozhu233/ifaR.handtools documentation built on May 17, 2019, 2:30 p.m.