Non-parametric test for trend across ordered groups (STB-9: snp4) --------------------------------------------------- ^nptrend^ varlist [^if^ exp] [^in^ range]^, by(^groupvar) [^tr^end^(^scorevar^)^] Description ----------- ^nptrend^ performs a non-parametric test for trend across ordered groups. This test, developed by Cuzick (1985), is an extension of the Wilcoxon rank-sum test and is a useful adjunct to the Kruskal-Wallis test (see ^help kwallis^). Formula for the test statistic is given by Cuzick(1985) and Altman(1991). Correction for ties is incorporated into the formula. ^groupvar^ is a grouping variable, and ^scorevar^ defines scores for groups. When ^trend(scorevar)^ is not specified, the values of the variable ^groupvar^ are used as the scores. Example ------- Consider the following data (Altman 1991): Group Transmission of Ocular exposure to ultraviolet radiation visible light ----------------------------------------------------------------------- 1 < 25% 1.4 1.4 1.4 1.6 2.3 2.3 2 25 to 35% 0.9 1.0 1.1 1.1 1.2 1.2 1.5 1.9 2.2 2.6 2.6 2.6 2.8 2.8 3.2 3.5 4.3 5.1 3 > 35% 0.8 1.7 1.7 1.7 3.4 7.1 8.9 13.5 ------------------------------------------------------------------------- We can use ^nptrend^ to test for a trend of increasing exposure across the three groups. When we do not specify scores for groups, they are defined by the grouping variable ^group^: Example, continued ------------------ . ^nptrend exp, by(group)^ Test: Trend across groups gr _Score _Obs _RankSum 1 1 6 76.00 2 2 18 290.00 3 3 8 162.00 z = 1.519 probability = 0.1288 When the groups are given any equally spaced scores, such as -1 0 1, we obtain the same answer as above. To illustrate the effect of changing scores, an analysis of these data with scores 1, 2, 5 (admittedly not very sensible in this case) gives: Example, concluded ------------------ . ^nptrend exp, by(group) tr(score)^ Test: Trend across groups group _Score _Obs _RankSum 1 1 6 76.00 2 2 18 290.00 3 5 8 162.00 z = 1.464 probability = 0.1432 This example suggests that the analysis is not all that sensitive to the scores chosen. References ---------- Altman, D. G. 1991. ^Practical Statistics for Medical Research^. London: Chapman and Hall, 215-217. Cuzick, J. 1985. A Wilcoxon-type test for trend. ^Statistics in^ ^Medicine^ 4: 87-90. Authors ------- K. A. Stepniewska and D. G. Altman, Imperial Cancer Research Fund, London. EMAIL k_stpniewska@@icrf.ac.uk