comparison_with_ties: Comparison with ties

Description Usage Arguments See Also Examples

Description

Compare numeric values, returning an inbetween value for ties

Usage

1
2
3
4
5
6
7
x %tgt% y

tgt(x, y, bias = 0.5)

x %tlt% y

tlt(x, y, bias = 0.5)

Arguments

x, y

numeric values to be compared

bias

what bias should be given to ties? 0.5, the default, is considered neutral as it's halfway between 1 and 0 (true and false).

See Also

Comparison, tied_triple_test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
1:5 %tlt% 3
1:5 %tgt% 3

c(1, 4, 3, 1) %tlt% c(1, 3, 3, 2)
c(1, 4, 3, 1) %tgt% c(1, 3, 3, 2)

# Calculate Mann–Whitney U statistic
set.seed(1)
x <- sort(round(runif(20)*13, 1))
y <- sort(round(runif(15)*10, 1))
o <- outer(x, y, "%tgt%")

sum(o)
wilcox.test(x, y, exact=FALSE)$statistic

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.