Learn R Programming

mcradds (version 1.1.1)

getOutlier: Detect Outliers From BAsummary Object

Description

[Experimental]

Detect the potential outliers from the absolute and relative differences in BAsummary object with 4E and ESD method.

Usage

getOutlier(object, ...)

# S4 method for BAsummary getOutlier( object, method = c("ESD", "4E"), difference = c("abs", "rel"), alpha = 0.05, h = 5 )

Value

A list contains the statistics results (stat), outliers' ord id (ord), sample id (sid), matrix with outliers (outmat) and matrix without outliers (rmmat).

Arguments

object

(BAsummary)
input from blandAltman function to generate the Bland-Altman analysis result that contains the absolute and relative differences.

...

not used.

method

(string)
string specifying which method to use. Default is ESD.

difference

(string)
string specifying which difference type to use for ESD method. Default is abs that means absolute difference, and rel is relative difference.

alpha

(numeric)
type-I-risk. Only used when the method is defined as ESD.

h

(integer)
the positive integer indicating the number of suspected outliers. Only used when the method is defined as ESD.

Examples

Run this code
data("platelet")
# Using `blandAltman` function with default arguments
ba <- blandAltman(x = platelet$Comparative, y = platelet$Candidate)
getOutlier(ba, method = "ESD", difference = "rel")

# Using sample id as input
ba2 <- blandAltman(x = platelet$Comparative, y = platelet$Candidate, sid = platelet$Sample)
getOutlier(ba2, method = "ESD", difference = "rel")

# Using `blandAltman` function when the `tyep2` is 2 with `X vs. (Y-X)/X` difference
ba3 <- blandAltman(x = platelet$Comparative, y = platelet$Candidate, type2 = 4)
getOutlier(ba3, method = "ESD", difference = "rel")

# Using "4E" as the method input
ba4 <- blandAltman(x = platelet$Comparative, y = platelet$Candidate)
getOutlier(ba4, method = "4E")

Run the code above in your browser using DataLab