calculateCliffd: calculateCliffd

View source: R/NPSimulation.R

calculateCliffdR Documentation

calculateCliffd

Description

This function implements finds Cliff's d and its confidence intervals. The null hypothesis is that for two independent group, P(X<Y)=P(X>Y). The function reports a 1-alpha confidence interval for P(X>Y)-P(X<Y). The algorithm computes a confidence interval for Cliff's d using the method in Cliff, 1996, p. 140, eq 5.12. The function is based on code produce by Rand Wilcox but has been amended. The plotting function has been removed and the dependency on Wilcox's binomci function has been removed. Construction of confidence intervals if values in one group are all larger than values in the other group has been amended to use the smallest non-zero variance method. Upper and lower confidence interval bounds cannot assume invalid values, i.e. values <-1 or >1.

Usage

calculateCliffd(x, y, alpha = 0.05, sigfig = -1)

Arguments

x

is a vector of values from group 1

y

is a vector of values from group 2

alpha

is the Type 1 error level for statistical tests

sigfig

is the number of significant digit. If sigfig>0 the data in x and y is truncated to the specified value.

Value

list including the value of Cliffs d its consistent variance and confidence intervals and the equivalent probability of superiority value and its confidence intervals.

Author(s)

Rand Wilcox, amendments Barbara Kitchenham and Lech Madeyski

Examples

x=c(1.2,3,2.2,4,2.5,3)
y=c(3,4.2,4,6,7,5.9)
calculateCliffd(x,y)
#  $n1
# [1] 6
# $n2
# [1] 6
# $d
# [1] -0.8611111
# $sqse.d
# [1] 0.02017931
# $phat
# [1] 0.06944444
z=c(1,2,3,4)
y=c(5,6,7,8)
calculateCliffd(z,y)
# $n1
# [1] 4
# $n2
# [1] 4
# $d
# [1] -1
# $sqse.d
# [1] 0.009765625
# $phat
# [1] 0

reproducer documentation built on Oct. 18, 2023, 5:10 p.m.