Skip to contents

[Experimental]

Helper function computes the difference with specific type.

Usage

h_difference(x, y, type)

Arguments

x

(numeric)
reference method.

y

(numeric)
test method.

type

(integer)
integer specifying a specific difference for Bland-Altman (default is 3). Possible choices are: 1 - difference with X vs. Y-X (absolute differences). 2 - difference with X vs. (Y-X)/X (relative differences). 3 - difference with 0.5*(X+Y) vs. Y-X (absolute differences). 4 - difference with 0.5*(X+Y) vs. (Y-X)/X (relative differences). 5 - difference with 0.5*(X+Y) vs. (Y-X)/(0.5*(X+Y)) (relative differences).

Value

a matrix contains the x and y measurement data and corresponding difference.

Examples

h_difference(x = c(1.1, 1.2, 1.5), y = c(1.2, 1.3, 1.4), type = 5)
#>        x   y x_ba        y_ba
#> [1,] 1.1 1.2 1.15  0.08695652
#> [2,] 1.2 1.3 1.25  0.08000000
#> [3,] 1.5 1.4 1.45 -0.06896552