Skip to content

ENH: k-sample trend tests #1130

Open
Open

Description

@josef-pkt

k-sample test with Null hypthesis that mean or median are the same and alternative hypothesis that the mean or median are ordered, increasing or decreasing.

see https://groups.google.com/d/msg/pystatsmodels/PLD-QdF7OxI/9UI982MbsBoJ

Cuzick's trend test
https://gist.github.com/josef-pkt/7035711
I have a cleaned up version.

(to go in statsmodels.stats.nonparametric, but I don't see where I have started the code for that, I thought I did.)

Activity

  1. added this to the 0.8 milestone on Sep 30, 2015
  2. modified the milestones: 0.8, 0.12 on Mar 1, 2020
  3. josef-pkt commented on Mar 1, 2020

    @josef-pkt
    MemberAuthor

    Bretz, Frank. 2006. “An Extension of the Williams Trend Test to General Unbalanced Linear Models.” Computational Statistics & Data Analysis 50 (7): 1735–48. https://doi.org/10.1016/j.csda.2005.02.005.

    based on partial skimming:
    this is a max-T test for ordered pair comparisons. Distribution of test statistic is max of correlated multivariate t distribution, and computation of p-values looks similar to tukey-hsd
    With Bretz as author I guess, he is using his multivariate t package/algorithms

    related aside: R package lawstat has several hypothesis test for oneway homogeneous variance tests against monotonic or trend alternatives.

  4. modified the milestones: 0.12, 0.13 on Aug 11, 2020
  5. modified the milestones: 0.13, 0.15 on Aug 20, 2022
  6. josef-pkt commented on Aug 20, 2022

    @josef-pkt
    MemberAuthor

    a note on different types of "trend" tests

    • two-sided alternative: standard trend tests like Cochran-Armitage are testing against a (weakly) monotonic alternative, the trend can go either up or down. It is not a one-sided test for increasing trend (e.g. what we want with dose-response data)
    • single statistic versus multiplicity : linear trend test or tests for other trend "scores" or contrasts have a single test statistic, Other tests like multiple contrasts/scores tests require multiple testing corrections.
    • singe inequality versus mutivariate inequalities: if we want to test against a one-sided alternative, then the general version would require monotonicity inequality at every point. (hypothesis with multiple inequalities are still a pain, no support yet)
    • non-point null hypothesis: equivalence (*1), nonequivalence/nonnegligible trend (*2), superiority. ...

    the following are for simple linear trend with equivalence or non-equivalence hypothesis tests on slope coefficient:

    *1
    Dixon, Philip M., and Joseph H. K. Pechmann. 2005. “A Statistical Test to Show Negligible Trend.” Ecology 86 (7): 1751–56. https://doi.org/10.1890/04-1343.

    *2
    Camp, Richard J., Nathaniel E. Seavy, P. Marcos Gorresen, and Michelle H. Reynolds. 2008. “A Statistical Test to Show Negligible Trend: Comment.” Ecology 89 (5): 1469–72. https://doi.org/10.1890/07-0462.1.

    Dixon, Philip M., and Joseph H. K. Pechmann. 2005. 2008. “A Statistical Test to Show Negligible Trend: Reply.” Ecology 89 (5): 1473–1473. https://doi.org/10.1890/07-1871.1.

  7. josef-pkt commented on Aug 20, 2022

    @josef-pkt
    MemberAuthor

    aside: coding for trend, consecutive differences
    monotonicity would require that all coefficients are >= 0, i.e. non-negativity constraints. (we can estimate it using fit with bounds constraint, but we don't have correct inference for that.)

    https://stats.oarc.ucla.edu/spss/faq/coding-systems-for-categorical-variables-in-regression-analysis-2/#REPEATED%20EFFECT%20CODING

    some older articles use Helmert and reverse-helmert coding for trend testing

  8. josef-pkt commented on Aug 20, 2022

    @josef-pkt
    MemberAuthor

    Jonckheere-Terpstra Trend Test

    It should be possible to implement it for r x c contingency tables with two cusum (similar to multivariate cell cdf) which should be relatively fast and not require the explicit double loop.

    (I guess the weighted version by ... would require the full double loop. unless we can recursively add the weights, maybe similar to exponential weighted control charts, but here it's linear weights.)

    e.g.
    https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_freq_details75.htm

  9. josef-pkt commented on Nov 4, 2022

    @josef-pkt
    MemberAuthor

    random find (package used in a stackexchange question)
    I didn't look closely at what it does

    https://github.com/mmhs013/pyMannKendall

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions