Learn R Programming

biostats (version 1.1.1)

outliers: Descriptive and Visual Outlier Assessment

Description

Identifies outliers using Tukey's interquartile range (IQR) method and provides descriptive statistics and visualizations for outlier assessment in numeric data.

Usage

outliers(data, x, threshold = 1.5, color = "#79E1BE")

Value

An object of class "outliers" containing a list with outlier statistics and ggplot objects.

Arguments

data

Dataframe containing the variables to be analyzed.

x

Character string indicating the variable to be analyzed.

threshold

Numeric value multiplying the IQR to define outlier boundaries. Default: 1.5.

color

Character string indicating the color for non-outlier data points. Default: "#79E1BE".

Examples

Run this code
# Simulated clinical data
clinical_df <- clinical_data()

# Basic outlier detection
outliers(clinical_df, "biomarker")

# Using custom threshold
outliers(clinical_df, "biomarker", threshold = 1.0)

Run the code above in your browser using DataLab