Application of Ghosh, Grizzle and Sen s Nonparametric Methods in Longitudinal Studies Using SAS PROC GLM Chan Zeng and Gary O. Zerbe Department of Preventive Medicine and Biometrics University of Colorado Health Sciences Center Denver, Colorado, U.S.A. Abstract. The 973 paper Nonparametric methods in longitudinal studies by Ghosh, Grizzle and Sen provides a very useful nonparametric approach to the statistical analysis of longitudinal data. We briefly review this paper and indicate how easily their method can be implemented in SAS PROC GLM. We reproduce their example, and demonstrate that permutation p values obtained from a large random sample of the permutations or exact F approximations recently added to SAS PROC GLM is a better approach than their chi-square approximation. Key words: Multivariate permutation test; Multivariate rank sum test; Nonparametric multivariate general linear model.
. Introduction The paper presented by Ghosh, Grizzle and Sen (973) provides a very useful nonparametric method for the statistical analysis of longitudinal data. Their proposed procedure includes two steps. First, they transform the raw data to regression coefficients, such as intercepts and slopes, and then transform the regression coefficients to ranks. Second, the ranks are then subjected to a multivariate rank sums test, proposed by Puri and Sen (966), that did not require the assumption of multivariate normality. We revisit this paper and indicate that their method can be easily implemented in SAS PROC GLM. We reproduce their example, and also test their hypotheses using random samples from the permutation distribution in addition to chi-square and F approximations. 2. Review of Ghosh, Grizzle and Sen paper In this section we briefly review the paper by Ghosh, Grizzle, and Sen in the notation of the SAS procedure GLM (SAS Institute Inc, 2004) indicating how their analysis can be implemented with that procedure. 2. SAS Notation SAS PROC GLM considers the multivariate general linear model Y = Xβ + ε, where Y is a (n x p) matrix of n observations by p dependent variables, X is an (n x k) design or regression matrix, with k the number of parameters per dependent variable, β is a (k x p) matrix of model parameters, and ε is an (n x p) matrix of errors. The rows of ε are assumed independent and identically distributed with a multivariate normal 0, Σ xp pxp. Ghosh et al. (973) remove the multivariate normality assumption and permit the 2
observations to take on discrete values. The ordinary least squares (OLS) estimate for β - (Y-Xb)'(Y-Xb) is b = (X'X) X'Y. Σ is estimated by S=. kxp pxp n - rankx We wish to test the multivariate general linear hypothesis H 0 : LβM=0 versus H A : LβM 0, where L and M are matrices of specified constants, and LβM is estimable. All multivariate tests carried out by the SAS GLM procedure first construct the matrices H and E, the sums of squares and cross products matrices for the hypothesis and the error, respectively: ( ) H=SS(LbM) = M'( Lb)' L X'X L' ( Lb) M E = M'(Y'Y-b'(X'X)b)M Four classical test statistics are reported in SAS GLM multivariate analysis of variance output. Each of these statistics is a function of the eigenvalues of the matrix E - Hor ( E) H H+ : Wilks Lambda Λ= E E+ H Pillai s Trace V = trace H( H+ E) Hotelling-Lawley Trace U = trace - EH Roy s Maximum Root = λ, the largest eigenvalue of - EH Under the multivariate normality assumptions all four test statistics can be approximated by F distributions (SAS Institute Inc, 2004). In the release 9.0 of SAS/STAT software, if the option MSTAT=EXACT is specified, p values for Wilk s Lambda, the Hotelling- Lawley Trace, and Roy s Maximum root can be computed exactly, and p values for 3
Pillai s trace are from an F approximation that is more accurate than the default (SAS Institute Inc, 2004). Although called exact, the p values for Wilk s Lambda, the Holelling-Lawley Trace, and Roy s Maximum root, according to the references listed in the SAS GLM documentation, are still approximations, albeit extremely accurate approximations, for distributions obtained under normal theory. 2.2 Example Ghosh, Grizzle, and Sen (GGS) transform each dependent variable separately to ranks (, 2,, n). They then consider randomly permuting the transformed dependent variables within blocks, which may be indicated by dummy variables in the design matrix X. As an example, they present data for a single block with 5 groups of Sprague-Dawley rats receiving a drug (beta-amino propionitrile) for varying durations. For each rat, knee stiffness (angle between the tibia and the femur as a function of weight added to the distal end of the tibia) was measured for several weights and transformed to half angle sines. The data were then transformed to intercepts and slopes of regression lines of half angle sine on weight fit to the two regions of the stiffness curves. These intercepts and slopes are displayed in GGS Figure B, Table, and our SAS code below. ˆ γ (gamma) and ˆα (alpha) are the estimated intercept and slope respectively of the first region of the response line, while ˆ γ 2 (gamma2) and ˆα 2 (alpha2) are those for the second. 4
data Example; input group gamma alpha gamma2 alpha2; datalines; 0.33 0.0332 0.7777 0.0092 0.3202 0.0287 0.7438 0.040 0.3786 0.392 0.029 0.0270 0.7675 0.5520 0.0094 0.0236 0.3836 0.0402 0.7800 0.096 2 0.3869 0.4524 0.0383 0.372 0.7092 0.7487 0.074 0.0255 2 0.3634 0.03 0.889 0.062 2 2 0.3734 0.3756 0.0569 0.0495 0.769 0.7598 0.065 0.036 2 0.436 0.0568 0.874 0.092 3 3 0.3596 0.400 0.0604 0.0468 0.852 0.839 0.003 0.006 3 0.386 0.0374 0.604 0.0229 3 3 0.3968 0.3963 0.042 0.0286 0.7283 0.7662 0.0226 0.00 4 0.3603 0.0470 0.697 0.0437 4 4 0.3452 0.3962 0.038 0.0407 0.7473 0.7848 0.072 0.065 4 0.3763 0.0434 0.8062 0.084 4 5 0.390 0.5005 0.0406 0.0725 0.7334 0.7767 0.0293 0.0355 5 0.5699 0.0699 0.739 0.0269 5 5 0.64 0.3803 0.0670 0.047 0.8009 0.7540 0.076 0.0270 5 0.395 0.9765 0.858 0.037 ; These regression coefficients were then transformed to vectors of ranks R = ( R () R ( 2) R ( p) ) where ( t) ij ij ij ij R ij + R t n subject j in group i. Adjusted ranks ij( ) 2 is the rank of dependent variable t for were also computed. 5
The SAS code below reproduces the intermediate results in GGS Table 3. proc rank data= Example out=rankings; var gamma alpha gamma2 alpha2; ranks RankG RankA RankG2 RankA2; data AdjRank; set rankings; n = 26; mean = (n+)/2; AdjRankG = RankG - mean; AdjRankA = RankA - mean; AdjRankG2 = RankG2 - mean; AdjRankA2 = RankA2 - mean; drop gamma alpha gamma2 alpha2 mean; proc print data=adjrank; title "Ranks and Adjusted Ranks of Data for Example"; proc means data=adjrank mean; title "Means of Ranks and Adjusted Ranks for Example"; class group; var RankG RankA RankG2 RankA2 AdjRankG AdjRankA AdjRankG2 AdjRankA2; run; To reproduce the correlations and covariances in GGS Table 4, first we obtain the total sum of squares and cross products matrix T corrected for the mean as the error sum of squares and cross products matrix E from MANOVA model with only a column of ones in the design matrix X using SAS code: 26x proc glm data=rankings; model RankG RankA RankG2 RankA2= /nouni; manova H=intercept /printe; run; Then the output below is the GGS total sum squares and cross products matrix T E = Error SSCP Matrix RankG RankA RankG2 RankA2 RankG 462.5 493.5 45.5 549 RankA 493.5 462.5 637.5 308.5 RankG2 45.5 637.5 462.5-776.5 RankA2 549 308.5-776.5 462 6
The Spearman rank covariance matrix V n T by V T /n R () t R ( u) matrix V in GGS equations (3.0) and (3.) is related to n n i + n+ = = n ij 2 ij 2. The rank covariance i= j= below reproduces GGS Table 4. V RankG RankA RankG2 RankA2 RankG 56.25 8.980769.75 2.5385 RankA 8.980769 56.25 24.5923.865385 RankG2.75 24.5923 56.25-29.86538 RankA2 2.5385.865385-29.86538 56.230769 The printe option in the above MANOVA statement reproduces the Spearman correlations in GGS Table 4 Partial Correlation Coefficients from the Error SSCP Matrix / Prob > r DF = 25 RankG RankA RankG2 RankA2 RankG.000000 0.337436 0.03 0.375449 0.098 0.880 0.0587 RankA 0.337436.000000 0.435897 0.20976 0.098 0.0260 0.3009 RankG2 0.03 0.435897.000000-0.5303 0.880 0.0260 0.0052 RankA2 0.375449 0.20976-0.5303.000000 0.0587 0.3009 0.0052 To compare groups, the multivariate one way analysis of variance SAS code, proc glm data=rankings; class group; model RankG RankA RankG2 RankA2=group/nouni; manova H=group / printh printe; run; created the necessary between groups sum of squares and cross products matrix as the hypothesis sum of squares and cross products matrix H 7
H = Type III SSCP Matrix for group RankG RankA RankG2 RankA2 RankG 444.46666667 477.53333333 9.4 49.86666667 RankA 477.53333333 028.4666667 36 307.23333333 RankG2 9.4 36 4 56 RankA2 49.86666667 307.23333333 56 330.56666667 and the within groups sum of squares and cross products matrix as the error sum of square and cross product matrix E. pxp E = Error SSCP Matrix RankG RankA RankG2 RankA2 RankG 08.0333333 5.966666667-45.9 399.3333333 RankA 5.966666667 434.03333333 276.5.2666666667 RankG2-45.9 276.5 32.5-832.5 RankA2 399.3333333.2666666667-832.5 3.4333333 The total sum of squares and cross products matrix is T = H+ E. The same code provided the test statistics below. MANOVA Test Criteria and F Approximations for the Hypothesis of No Overall group Effect on the Variables Defined by the M Matrix Transformation H = Type III SSCP Matrix for group E = Error SSCP Matrix S=4 M=-0.5 N=8 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.607625 2.84 6 55.629 0.0020 Pillai's Trace.9075833 2.23 6 84 0.0099 Hotelling-Lawley Trace 3.2467032 3.47 6 30.444 0.005 Roy's Greatest Root 2.64280 3.72 4 2 <.000 NOTE: F Statistic for Roy's Greatest Root is an upper bound. 8
Letting V=T/n, the GGS rank sum L statistic is then g g n n L= ni Ri R V Ri R trace ni Ri R V Ri R n px px pxp = px px px px pxp i n = i= px px g n n = trace niv Ri R Ri R n pxp = trace V H i= px px px px n pxp pxp n T trace H ( n ) trace = = T H = ( n ) Pillai ' s trace n n pxp pxp pxp pxp = (26 )*.90758 = 29.769 Based on an approximating F distribution p = 0.0099 as reported in SAS output. It also yields p = 0.092 based on chi-squared distribution with p(c-) = 4(5-) =6 degrees of freedom as reported in the GGS paper. Hence we concur that there are significant differences between the five mean knee stiffness curves. It is important to note that Ghosh, Grizzle, and Sen considered this chi-squared test an approximation to an underlying permutation test of the ranks. We are simply demonstrating thus far how SAS PROC GLM can be used as a computational tool to obtain the GGS approximate test. We note that under normal theory SAS PROC GLM provides several competing test statistics. One competing test statistic is the Hotelling- Lawley trace, g g U= ni Ri R E i trace ni i i px px pxp R R = R R E R R px px px px pxp i= i= px px g = trace nie Ri R Ri R = trace E H pxp = 3.2467 px px px px pxp pxp i= with p-value = 0.005 based on an approximate F distribution. Others are Roy s maximum root and Wilk s lambda and their F approximations. 9
The following SAS code compares the five groups separately for the first regression line and the second regression line. proc glm data=rankings; class group; model RankG RankA RankG2 RankA2=group/nouni; manova H=group M=RankG, RankA / printh printe; manova H=group M=RankG2, RankA2 / printh printe; run; Below are the SAS output for MANOVA tests for group effects for the first regression line MANOVA Test Criteria and F Approximations for the Hypothesis of No Overall group Effect on the Variables Defined by the M Matrix Transformation H = Type III SSCP Matrix for group E = Error SSCP Matrix S=2 M=0.5 N=9 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.23299243 5.36 8 40 0.000 Pillai's Trace 0.8878746 4.9 8 42 0.0009 Hotelling-Lawley Trace 2.77323892 6.75 8 26.353 <.000 Roy's Greatest Root 2.575082 3.50 4 2 <.000 NOTE: F Statistic for Roy's Greatest Root is an upper bound. NOTE: F Statistic for Wilks' Lambda is exact. 0
And for the second regression line MANOVA Test Criteria and F Approximations for the Hypothesis of No Overall group Effect on the Variables Defined by the M Matrix Transformation H = Type III SSCP Matrix for group E = Error SSCP Matrix S=2 M=0.5 N=9 Statistic Value F Value Num DF Den DF Pr > F Wilks' Lambda 0.52248633.92 8 40 0.084 Pillai's Trace 0.5058332.78 8 42 0.090 Hotelling-Lawley Trace 0.85972780 2.09 8 26.353 0.0734 Roy's Greatest Root 0.7922949 4.5 4 2 0.024 NOTE: F Statistic for Roy's Greatest Root is an upper bound. NOTE: F Statistic for Wilks' Lambda is exact. The L statistics can be easily obtained by multiplying the Pillai s traces by (n-). For the first regression line, L = (26-)*0.8878746 = 22.967865, with p value = 0.0046 based on the approximate chi-squared distribution with p(c-) = 2(5-) = 8 degrees of freedom. For the second regression line, L = (26-)*0.5058332 = 2.645783 with approximate p value 0.246. These are the same results as reported in the GGS paper. We concur that the most important differences occur within the first segment of the response line. Closer inspection of the individual slopes and intercepts leads to CGS second conclusion that within this (first) segment differences among the slopes are the most important. We then recalculate the above p values by executing the actual permutation tests. Table displays F approximated p values and exact p values from SAS GLM, along with actual permutation p value from 00,000 random samples of permutation distribution, for the hypothesis of no differences among five mean knee stiffness curves for both regression
lines (A), for intercepts and slopes of the st regression line (B), and for intercepts and slopes of the 2 nd regression lines (C). We note that p values obtained from random samples of the permutations for Wilk s lambda, Pillai s trace, Hotelling-Lawley trace and Roy s maximum root are very similar to the p values obtained from SAS GLM F approximations, where p values from GGS s rank sum L statistic are quite different. In general, we feel that the permutation p values are an improvement over the GGS chi square approximate p-values, and agreement between permutation p values and SAS GLM exact p values is very well in this example with ranked data. See how close their p values to the actual permutation p values in this ranked data? Since they agreed so well, then we thought why just use exact 3. Conclusion In this article, we reviewed the paper nonparametric methods in longitudinal studies by Ghosh, Grizzle and Sen, and reproduced their example via SAS PROC GLM. Hence, the reader does not need special software to execute this useful analysis. We have demonstrated that their rank sum test statistic L is equivalent to Pillai s trace, and that p values obtained by the F approximations agree more closely with the permutation p values than do the p-values from the chi-square approximations. We prefer permutation p values obtained from a large random sample of the permutations to the standard SAS GLM F or chi-square approximations. However, in the case of the ranked data in the example the agreement between the SAS PROC GLM exact p-values and the permutation p-values is so good that the exact values should be seriously considered. This considerable agreement is not expected to hold up this strongly in the absence of ranked data or extremely non-normal distributed data. 2
ACKNOWLEDGEMENTS This work was partially supported by NIH grants P30 CA046934 and P50 CA05887, National Institute of Mental Health (NIMH) Silvio O. Conte Center P50 MH068582-07, and (NIDA) DA09457. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. REFERENCES Ghosh, M., Grizzle, J. E., and Sen, P. K., 973. Nonparametric methods in longitudinal studies. Journal of the American Statistical Association 68, 29-36. Puri, M. L., and Sen, P. K., 966. On a class of multivariate multisample rank order tests. Sankhya A 28, 353-376. SAS Institute Inc, 2004. SAS/STAT 9. User's Guide. SAS Institute Inc., Cary, NC. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the authors: Chan.Zeng@uchsc.edu Gary.Zerbe@uchsc.edu 3
Table Permutation p values for hypothesis of no differences among five mean knee stiffness curves Hypothesis Test statistics Value F value GLM F approx p-value GLM exact p-value* Permutation p-value*** A: Wilk's lambda 0.6 2.8435 0.002 0.002 0.0028 Overall Group effect Pillai's trace.908 2.2253 0.0099 0.0053 0.0054 on both regression lines Hotelling-Lawley trace 3.2467 3.475 0.005 0.008 0.0025 Roy's maximum root 2.44 3.72 <0.000 0.002 0.0025 Puri & Sen L 29.769 0.092** 0.0054 B: Group effect on Wilk's lambda 0.233 5.36 0.000 0.000 0.0002 st regression line Pillai's trace 0.8879 4.9 0.0009 0.0006 0.0007 Hotelling-Lawley trace 2.7732 6.75 < 0.000 0.000 0.0002 Roy's maximum root 2.575 3.5 < 0.000 0.000 0.0002 Puri & Sen L 22.968 0.0046** 0.0007 C: Group effect on Wilk's lambda 0.5225.92 0.084 0.084 0.092 2nd regression line Pillai's trace 0.5058.78 0.09 0.0 0.082 Hotelling-Lawley trace 0.8597 2.09 0.0734 0.0727 0.0808 Roy's maximum root 0.792 4.5 0.024 0.0539 0.068 Puri & Sen L 2.6458 0.246** 0.082 *Used MSTAT=EXACT option in SAS GLM, p values for Wilk s lambda, Hotelling-Lawley trace and Roy s Max root are computed exactly. P values for Pillai s trace are based on F-approximation that is more accurate than the default. ** Approximated p values by chi-square distribution. *** From 00,000 random permutation samples 4