Skip to content

ENH/SUMM ranked data regression, hypothesis test versus nonparametric, rank based test #6523

Open

Description

@josef-pkt

Using ranked data in regression or standard hypothesis tests is close to their rank based counterparts in hypothesis tests.

example in statsmodels.sandbox.stats.multicomp.MultiComparison I had added conversion to ranks.

However, there are some differences in the results.
some links for that

https://eigenfoo.xyz/tests-as-linear/#6.1.4-Python-code:-Kruskal-Wallis (contains many comparisons of models and hypothesis tests)
based on
https://lindeloev.github.io/tests-as-linear/
which has a good set of links
https://lindeloev.github.io/tests-as-linear/#8_sources_and_further_equivalences

some stats.stackexchange questions and answers and similar
https://stats.stackexchange.com/questions/210529/are-parametric-tests-on-rank-transformed-data-equivalent-to-non-parametric-test
https://stats.stackexchange.com/questions/303269/common-statistical-tests-as-linear-models

https://seriousstats.wordpress.com/2012/02/14/friedman/
with reference to
Conover, W. J., & Iman, R. L. (1981). Rank transformations as a bridge between parametric and nonparametric statistics. American Statistician, 35, 124-129.

todo:
check kruskal in statsmodels.sandbox.stats.multicomp.MultiComparison again and see how far we can get with using standard methods with rank data.

Activity

  1. josef-pkt commented on Aug 11, 2020

    @josef-pkt
    MemberAuthor

    #6960 reference to Vargha, András, and Harold D. Delaney. 2000

    They compare tests for stochastic equality with Welch t-test and Welch Anova based on rank data.
    main reference for those are articles by Zimmerman and Zumbo 1992, 1993

    e.g. Vargha and Delaney mention that rank based t-test is equivalent to Mann-Whitney in large samples (asymptotically ?).

    aside: fligner in scipy is a test on equality of variances or dispersion, not median like Fligner-Policello
    Fligner-Policello is a rank test allowing for heteroscedasticity. (interpretation for median comparison relies on equal distribution except for shift. otherwise we only get stochastic equality as null)

    #6960 is a good starting point for adding general rank based methods to statsmodels.stats.

  2. josef-pkt commented on Aug 16, 2020

    @josef-pkt
    MemberAuthor

    starting point to look at it, I partially read Conover, Iman 1981a

    e.g. they show that the test statistic of the standard t-test on ranked data is a nonlinear transformation of the MW rank test statistic.

    Conover, W. J., and Ronald L. Iman. 1981a. “Rank Transformations as a Bridge Between Parametric and Nonparametric Statistics.” The American Statistician 35 (3): 124–29. https://doi.org/10.2307/2683975.
    ———. 1981b. “[Rank Transformations as a Bridge Between Parametric and Nonparametric Statistics]: Rejoinder.” The American Statistician 35 (3): 132–33. https://doi.org/10.2307/2683978.

    Conover, W. Jay. 2012. “The Rank Transformation—an Easy and Intuitive Way to Connect Many Nonparametric Methods to Their Parametric Counterparts for Seamless Teaching Introductory Statistics Courses.” Wiley Interdisciplinary Reviews: Computational Statistics 4 (5): 432–438. https://doi.org/10.1002/wics.1216.

    Fligner, Michael A. 1981. “[Rank Transformations as a Bridge Between Parametric and Nonparametric Statistics]: Comment.” The American Statistician 35 (3): 131–32. https://doi.org/10.2307/2683977.

    Noether, Gottfried E. 1981. “[Rank Transformations as a Bridge Between Parametric and Nonparametric Statistics]: Comment.” The American Statistician 35 (3): 129–30. https://doi.org/10.2307/2683976.

    for oneway anova, I added data transformation to get Levene, ... test for equality of variances or dispersion. That is implemented as general function that could take rank transformation i.e. rankdata from scipy.stats.
    This assumes we want to convert each sample separately into ranks, it doesn't work for ranking in total sample.

    I also read small parts of
    Zimmerman, Donald W., and Bruno D. Zumbo. 1993. “Rank Transformations and the Power of the Student t Test and Welch t’ Test for Non-Normal Populations with Unequal Variances.” Canadian Journal of Experimental Psychology/Revue Canadienne de Psychologie Expérimentale 47 (3): 523–39. https://doi.org/10.1037/h0078850.

    No formulas but a Monte Carlo, comparing t and welch-t on original data with t and welch-t on rank data
    Welch-t works well with non-normal distribution, unequal sample sizes and unequal variances, maybe a bit liberal but better than the others in those cases.

    aside:
    when ranking in total sample, then it is more convenient to work in long format, i.e. stacked data plus groups indicator.
    Main requirement for usability here is some function to transform to required ranks, and have the inference function using the same structure, i.e. list of arrays or stacked array plus groups.

    I haven't checked yet:
    We can replicate many standalone tests with regression/OLS (maybe without small sample adjustments)
    The same will apply if we use ranks as data instead of the original data.

  3. josef-pkt commented on Aug 16, 2020

    @josef-pkt
    MemberAuthor

    However, AFAIU, the rank transform will change the null hypothesis for arbitrary distributions.
    i.e. we get something like P(x1 > x2) instead of mean(x1) = mean(x2) or median(x1) = median(x2) or trimmed_mean(x1) = trimmed_mean(x2)

    e.g. are outliers outliers or part of the distribution.

    H0: statistic(x1) = statistic(x2) but allowing for F(x) != G(x) where F is distribution of x1 and G is distribution of x2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions