getOutlier {mcradds}R Documentation

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 signature 'BAsummary'
getOutlier(
  object,
  method = c("ESD", "4E"),
  difference = c("abs", "rel"),
  alpha = 0.05,
  h = 5
)

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.

Value

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

Note

Bland-Altman analysis is used as the input data regardless of the 4E and ESD method because it's necessary to determine the absolute and relative differences beforehand. For the 4E method, both of the absolute and relative differences are required to be define, and the bias exceeds the 4 fold of the absolute and relative differences. However for the ESD method, only one of them is necessary (the latter is more recommended), and the bias needs to meet the ESD test.

Examples

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")

[Package mcradds version 1.1.0 Index]