comp.dist.plot: Plotting Two Distributions Side by Side for Comparison

Description Usage Arguments Value Author(s) References Examples

View source: R/comp.dist.plot.R

Description

Plotting both distributions in one beanplot, and calculate the significance of difference between two distributions using Wilcoxon Rank Sum or Signed Rank Test. The verticle line shows the median values of the distributions. Use log = "x" to force logging the x-axis.

Usage

1
2
3
4
5
6
7
8
comp.dist.plot(dist1, dist2,
               legend1 = "Distribution 1",
               legend2 = "Distribution 2",
               legendpos = "topright",
               col1 = "#C8C8C8", col2 = "#646464",
               xlab = "", cut = TRUE,
               paired = FALSE,
               ...)

Arguments

dist1

the first distribution for comparison

dist2

the second distribution for comparison

legend1

the label for the legend of the first distribution

legend2

the label for the legend of the second distribution

legendpos

the position of the legend, specified by a single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center".

col1

the color for the first distribution

col2

the color for the second distribution

xlab

the label for the x-axis

cut

logical; if TRUE, the beanplot will be cut at the minimum / maximum value of the distribution to avoid extending the beanplot to illegal values

paired

logical; if TRUE, a Wilcoxon signed rank test of the null that dist1 - dist2 is symmetric about 0 (or mu if specified) is performed; if FALSE, a Wilcoxon rank sum test (equivalent to the Mann-Whitney test: see the Note) is carried out. In this case, the null hypothesis is that dist1 and dist2 differ by a location shift of 0 (or mu if specified) and the alternative is that they differ by some other location shift. See wilcox.test for details

...

further arguments to be passed to wilcox.test

Value

A list of class htest. See wilcox.test for details.

Author(s)

Maintainer: Dayi Lin http://lindayi.me

References

David F. Bauer (1972), Constructing confidence sets using rank statistics. Journal of the American Statistical Association 67, 687<e2><80><93>690.

Please consider citing the following paper when using this package and the visualization style of effect size:

Lin, D., Bezemer, C. P., & Hassan, A. E. (2018). An empirical study of early access games on the Steam platform. Empirical Software Engineering, 23(2), 771-799.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
temp.dist1 = rnorm(100,1,2)
temp.dist2 = rnorm(100,-1,2)

# Basic (by default unpaired)
comp.dist.plot(temp.dist1, temp.dist2)

# Without cut
comp.dist.plot(temp.dist1, temp.dist2, cut = FALSE)

# Paired test
comp.dist.plot(temp.dist1, temp.dist2, paired = TRUE)

lindayi/distcomp documentation built on May 20, 2019, 11:59 a.m.