For the two independent samples case, the Mann-Whitney U-test is
calculated and W is reported from stats::wilcox.test. For the paired
samples case the Wilcoxon signed rank test is run and V is reported.
Since there is no single commonly accepted method for reporting effect size
for these tests we are computing and reporting r (computed as
\(Z/\sqrt{N}\)) along with the confidence intervals associated with the
estimate. Note that N here corresponds to total sample size for
independent/between-subjects designs, and to total number of pairs (and
not observations) for repeated measures/within-subjects designs.
Note: The stats::wilcox.test function does not follow the
same convention as stats::t.test. The sign of the V test statistic
will always be positive since it is the sum of the positive signed ranks.
Therefore, V will vary in magnitude but not significance based solely
on the order of the grouping variable. Consider manually
reordering your factor levels if appropriate as shown in the second example
below.