Repository navigation
Description
a version is also known as CL common language effect size
"
The purpose
of this article is to introduce yet another effect size statistic
but one that is so readily understood by nonstatisticians that we
have chosen to call it the common language effect size indicator.
"
silly name, I advocate adding bese "best effect size ever", where the author needs to specify a quasilinear utility function where the linear part is the money that they bet that the effectsize is correct and useful. :)
note, I think this is also Brunner-Munzel statistic or a version or function of it under nonparametric assumptions. #3575
(aside: stochastic dominance and quantitative measures for it are missing)
(I only skimmed small parts of the following)
McGraw, Kenneth O., and S. P. Wong. 1992. “A Common Language Effect Size Statistic.” Psychological Bulletin 111 (2): 361–65. https://doi.org/10.1037/0033-2909.111.2.361.
Ruscio, John, and Tara Mullen. 2012. “Confidence Intervals for the Probability of Superiority Effect Size Measure and the Area Under a Receiver Operating Characteristic Curve.” Multivariate Behavioral Research 47 (2): 201–23. https://doi.org/10.1080/00273171.2012.658329.
Vargha, András, and Harold D. Delaney. 2000. “A Critique and Improvement of the CL Common Language Effect Size Statistics of McGraw and Wong.” Journal of Educational and Behavioral Statistics 25 (2): 101–32. https://doi.org/10.3102/10769986025002101.
python implementation https://github.com/ajschumacher/cles
related to more general issue
#6523 rank based methods
#3575 Brunner-Munzel test
maybe related #799 rank based multiple comparisons
Activity
josef-pkt commentedon Aug 10, 2020
"
Care should be taken when searching the literature for references to the Mann–Whitney measure because this measure has been invented, reinvented, and advocated in the statistical literature with a plethora of different names: “Measure of stochastic superiority of Y2 over Y1” (Klotz, 1966), “Common Language Effect Size Indicator” (McGraw & Wong, 1992), “Relative Effect” (Brunner, Domhof, & Langer, 2002; Brunner & Langer, 1999), “Area Under the Curve” (of a receiver operating characteristic), AUC (Kraemer & Kupfer, 2006) “probability index” (Acion, Peterson, Temple, & Arndt, 2006), among many others.
"
quote from
Rahlfs, Volker, and Helmuth Zimmermann. 2019. “Effect Size Measures and Their Benchmark Values for Quantifying Benefit or Risk of Medicinal Products.” Biometrical Journal 61 (4): 973–82. https://doi.org/10.1002/bimj.201800107.
nonparametric, rank based CL can be directly computed from Mann-Whitney statistic.
From what I can see now in this literature, we get hypothesis test (Mann-Whitney, Brunner-Munzel), effect size and confidence intervals for P(x1 > x2) + tie handling.
asides:
ROC, two sample probplots and similar can be used to compare entire distributions in two (or k) samples, with P(x1 > x2) one definition of stochastic dominance (superiority).
IIRC: First order stochastic is F_1(x) < F_2(x) for all x, which should mean curve is below (?) 45 degree line in prob plot.
What's the relationship to one-sided two-sample KS test ?)
edit
another MW measure article in medicine
Rahlfs Volker W., Zimmermann Helmuth, and Lees Kennedy R. 2014. “Effect Size Measures and Their Relationships in Stroke Studies.” Stroke 45 (2): 627–33. https://doi.org/10.1161/STROKEAHA.113.003151.
and for an unusual topic, application of Brunner-Munzel test:
Neuhäuser, Markus, and Robert Poulin. 2004. “COMPARING PARASITE NUMBERS BETWEEN SAMPLES OF HOSTS.” Journal of Parasitology 90 (4): 689–91. https://doi.org/10.1645/GE-256R.
edit 2
section mentions equivalence to AUC, and also relationship to Gini coefficient
https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve
Also, the superiority probability is related to Somer's D. (articles mention that D can be used from many statistical packages to compute the prob. Gini and Somer's D are scaled to have equality at zero)
josef-pkt commentedon Aug 10, 2020
And with an interpretable effect size, we should also be able to get equivalence testing.
a quick search:
https://rdrr.io/cran/EQUIVNONINF/man/mawi.html
references Wellek's book
I found:
Wellek, S. 1996. “A New Approach to Equivalence Assessment in Standard Comparative Bioavailability Trials by Means of the Mann-Whitney Statistic.” Biometrical Journal 38 (6): 695–710. https://doi.org/10.1002/bimj.4710380608.
and maybe
Munzel, Ullrich, and Dieter Hauschke. 2003. “A Nonparametric Test for Proving Noninferiority in Clinical Trials with Ordered Categorical Data.” Pharmaceutical Statistics 2 (1): 31–37. https://doi.org/10.1002/pst.17.
Schmidtmann, Irene, Stavros Konstantinides, and Harald Binder. 2019. “Power of the Wilcoxon–Mann–Whitney Test for Non-Inferiority in the Presence of Death-Censored Observations.” Biometrical Journal 61 (5): 1187–1200. https://doi.org/10.1002/bimj.201700296.
and related, cited, citing work
(I didn't read any of it)
just a thought:
If we get confidence intervals for superiority probalility, then we might be able to invert it to get the p-value for the equivalence test, or for non-inferiority, superiority tests.
(I don't know if we can get the distribution of the test statistic for non-zero null value, i.e. null is not the equal hypothesis)
update
Munzel, Ullrich, and Dieter Hauschke. 2003. “A Nonparametric Test for Proving Noninferiority in Clinical Trials with Ordered Categorical Data.” Pharmaceutical Statistics 2 (1): 31–37. https://doi.org/10.1002/pst.17.
looks good
has standard one-sided test with a margin, nonzero null value
H0 : p <= p0 = 0.5 - delta
H1 : p > p0 = 0.5 - delta
so extending to tost should be easy.
also:
"It should be noted that the variance estimator for the classical Wilcoxon–Mann–Whitney test
with correction for ties is only consistent under the restriction F_T = F_S. Obviously, this condition
is violated under the shifted null hypothesis ..."
josef-pkt commentedon Aug 12, 2020
I'm giving up for now to get an overview
There are language differences in the specific literature but a few articles that compare different measures.
What is not clear yet whether or how much the different measures apply to the same situation.
e.g. kendall's tau is related to somers' d and stochastic superiority if one of the variables is binary.
Newson, Roger. 2002. “Parameters behind ‘Nonparametric’ Statistics: Kendall’s Tau, Somers’ D and Median Differences.” The Stata Journal 2 (1): 45–64. https://doi.org/10.1177/1536867X0200200103.
relationship auc and gini coefficient
https://towardsdatascience.com/using-the-gini-coefficient-to-evaluate-the-performance-of-credit-score-models-59fe13ef420
Schechtman, Edna, and Gideon Schechtman. 2016. “The Relationship between Gini Methodology and the ROC Curve.” SSRN Electronic Journal. https://doi.org/10.2139/ssrn.2739245.
somers' d is defined for bivariate variable using sign of diff of one variable, computation for stochastic superiority is in terms of rank. Using rank can be a computational shortcurt to comparing all differences between observations.
The advantage of knowing the exact relationship is that we can directly compute one measure from another (at least for the overlapping cases) and we would need to implement only one method.
It's easier to start implementation with
and then some more recent articles on confidence intervals and similar
aside: scipy doesn't have somers' d yet.
josef-pkt commentedon Aug 13, 2020
need helper functions (at least for checking and development) that link different ways of computing similar ranks.
e.g. WMW and Fligner policello use "placement ranks", i.e. rank of x1_i among all x2. (in the old times I used np.searchsorted for that)
This might be
rank_i among all obsminusrank_i within the sample of i. This is used in Brunner-Munzel (implemented in scipy.stats) for the variance computation.josef-pkt commentedon Aug 14, 2020
one piece
Somers d is rank correlation of a binary and a continuous variable, in Hmisc, d is related to AUC application in this case.
DescTools has a more general version that doesn't require a binary variable (based on their docstring)
https://www.rdocumentation.org/packages/DescTools/versions/0.99.37/topics/SomersDelta
prob computed in analogy to brunnermunzel matches up with somers' d in R Hmisc but not with code in https://stackoverflow.com/questions/59442544/is-there-an-efficient-python-implementation-for-somersd-for-ungrouped-variables
R code
my current extension and adjustment to scipy brunnermunzel in a notebook
josef-pkt commentedon Aug 15, 2020
nice when things work with mostly generic code
Based on Brunner-Munzel definitions and asymptotic normal or t distribution, we can get all the usual results, e.g.
The core results are finished in draft version.
structure: I have currently a function that computes all the basic rank statistics and variance (including equality test) and test for nonzero null, confint and tost in results instance.
A bit similar to Model-Results structure except I have a function instead of the model class.
I'm not sure how well this works with extensions, e.g. using different asymptotic or approximate distribution for inference in results. e.g. we might be able to get several
methodsfor confint similar to one sample proportion.In contrast to proportions, there is more setup-work, computing ranks and rank statistic, so reusing those is a computational advantage, so separate confint, test and tost functions is less appropriate.
Also it will not be easy to add permutation p-values to brunner-munzel here because they only cover the special case of stochastic equality, i.e. p=0.5 (which is the only case that scipy's
brunnermunzelhandles)location and name: no good ideas yet.
That depends on in which directlion this goes, i.e. more non-parametric, e.g. fligner-policello, ... or more in direction of stochastic superiority and dominance, i.e. properties of distributions besides simple moments.
currently stats is more organized by application topic and not by method, e.g. proportion, oneway, contingency tables
stats
descriptivestatshas a sign_test, the runs tests are in the sandboxrunsmodulemaybe stattools for now which is a "misc" module for stats.
josef-pkt commentedon Aug 15, 2020
reminder: I forgot to implement the shortcut to compute results based on counts for discrete ordered variables.
formulas in appendix of ...
(nonparametric stochastic ordering of ordered multinomial distributions)
not yet: k-sample extension, i.e. oneway equality of larger probabilities.
josef-pkt commentedon Aug 15, 2020
I will go for statsmodels.stats.nonparametric as location. We should get more rank and sign based methods to make it worth a separate module.
I added
stats.robust_comparewhich is the base for trimmed stats, but mostly used instats.oneway. robust_compare is now a misnomer because the "compare" code has moved to oneway.For nonparametric we have potentially methods in other modules, e.g. robust, rank or sign based variance computation. Other statistic under "robust" advertising are similar, e.g. quantile based moments like iqr and those for skew and kurtosis.
Multivariate rank statistics is mostly missing, maybe some in robust cov.
I'm still missing a good function name as replacement for brunnermunzel
The literature is using many different names, stochastically larger or (W)MW parameter.
rankcompare_2indep ? which could include MW, brunner-munzel and fligner-policello as special cases
prob = 0.5 does not imply first order stochastic dominance, only if cdfs don't cross.
ZeroOrderStochasticDominance is too much economics and not used in literature.
ProbabilityXXX would refer to MW parameter
rankcompare_2indepsounds fine, a bit similar to Wilcoxon ranksum testjosef-pkt commentedon Aug 15, 2020
note so I remember: for pairwise comparisons it is possible to have Condorcet cycles, reference?
(maybe we can compare ranks computed from total sample, i.e. all samples combined, instead of pairwise combined.)
josef-pkt commentedon Aug 15, 2020
we already have test_nonparametric in stats with
josef-pkt commentedon Aug 17, 2020
skimming some older literature
AFAIU right now:
p = Prob(x1 > x2), x1 ~ F, x2 ~ G
(continuous case, otherwise and half prob of ties)
Mann-Whitney 1947: test statistic is rescaled p= U/(mn), distribution/variance for p=0.5 derived under Null assumption that F = G
Fligner-Policello: test statistic is p, null is p=0.5, assumption F and G are symmetric () (implies test on equality of medians)
Brunner-Munzel and extension: test statistic p, H0: p=p0, assumption F and G arbitrary
(*) not sure: I don't see any assumption on F and G when they describe the asymptotic variance, they just cite a reference for it.
Wilcoxon 1945 ? (based on skimming) derives the distribution of ranksum under assumption F=G, i.e. x1, x2 come from the same population.
related implication (IIRC/IIUC), reference?
But no cdf crossing is an unlikely case, because normal distributions with equal mean but unequal variance have cdf crossing, (mean preserving spread), i.e. p=0.5 does not imply F=G.
I didn't check again: studentized permutation test
I guess we get distribution under the assumption that F and G differ loc and scale (not just a shift alternative)
F(x | mu, scale) = G(x | mu, scale)
somewhere I also have seen tacking differences in scale/variance out,
i.e. studentize, but than add mean (or median) back in.
Distribution freedoes not mean that we don't have strong assumptions on distributions in the two or k sample comparison.josef-pkt commentedon Aug 17, 2020
computational detail
placements is rank in combined minus rank in within sample
to replicate it with searchsorted, we need to use the midrank, otherwise the ranking is at the upper value (cdf)
Fligner Policello use placement =
rank in combined sampleminusindex in sorted first samplethis assumes no ties, (or using cdf/upper rank instead of midrank)
similarly I guess integrals with respect to empirical distribution function (ecdf) might use upper point and not mid rank
(not checked in details)
p = Integral G dFmore recent literature that handles also discrete case work with F- and F+, left and right continuous versions of cdf, and p-, p+ for probabilities.
josef-pkt commentedon Aug 17, 2020
still confusing
brunnermunzel is just the extension of Fligner-Policello to allow for discrete variables (?) (BM mentions something lie that in intro)
Fligner-Policello add unequal variance to Mann-Whitney
fligner-policello variance looks similar to brunner-munzel variance, but FP is defined in terms of placements, BM is defined in terms of midranks.
But with "mid-placements" they are the same.
note the estimate for p in MW, FP and BM is the same
MW assumes equal variance, FP and BM are for unequal var case,
(I still have small difference in FP and BM z/t-statistic, but I don't have FP var verified yet)
So, there might not be any practical reason anymore to use MW or FP instead of BM.
Equal var assumption in MW looks pretty unrealistic, and would only apply to distribution shift. (unless we are standardizing the scale)
josef-pkt commentedon Aug 18, 2020
numbers in example in Brunner Munzel are a bit wrong, mean ranks differ a bit from scipy's mean ranks
The permutation article by Neubert, Brunner 2007 has the same statistics and pvalue as scipy brunnermunzel
(aside: I think I mixed up about what studentized permutation tests are. They are not permuting studentized observations, they use standard permutation but with a heteroscedasticity robust test statistic, i.e.
use_var="unequal"as in Welch or BrunnerMunzel. (or HC in regression setting))(I went through that when I looked at brunner munzel for the first time)
josef-pkt commentedon Aug 18, 2020
I'm giving up on implementing Fligner-Policello
If we add proper tie handling to FP, then we just end up with brunner munzel, with maybe a tiny difference in variance and p-values.
results in R for FP have a large variation in p-values in small sample with ties
NSM3installed but doesn't run, my R is too old (mine is version 3.6.1, NSM3 built under 3.6.3 which is not compatible‘rlang’ 0.4.2 is already loaded, but >= 0.4.7 is requiredrobustranktoo many options, not documented, with p-values that differ from each other, one matches our brunnermunzel p-valuemod.wmw.test(a, b, perm=FALSE, method="fplarge", correct=FALSE)RVAideMemoirefp.testI guess that doesn't have proper tie handling, p-value pretty far away from brunnermunzel and from those inrobustrankpackage. fp.test is documented as test for difference in median under symmetric distribution assumption. Allow for nonzero diff in Null.josef-pkt commentedon Jan 25, 2021
Most of the things here have been merged with #6971 at least for two sample comparison
not merged yet are supports of post-estimation results for models.
e.g. AUC, c-statistic, ...
https://stackoverflow.com/questions/65875106/how-to-get-concordance-for-the-logistics-regression-model-in-statsmodels
josef-pkt commentedon Sep 29, 2021
more general: What would be good effectsize measures for comparing two distributions.
I found this issue again by chance #5328 (comment)
besides stochastic dominance
We also have robust measures for skew and kurtosis.
gof tests (resurrect equivalence testing for chisquare and similar gof tests. For superior testing we would need one-sided gof tests. Similarly, we have equivalence testing for oneway anova based on f- or chisquare statistic.)
We might have to use bootstrap to get confint and pvalues if standard distributions don't apply or need assumptions that are too strong.