Chapter Contents |
Previous |
Next |
The FREQ Procedure |
In this setting, Friedman's test is identical to the ANOVA (row means scores) CMH statistic when the analysis uses rank scores (SCORES=RANK). The three-way table uses subject (or subject group) as the stratifying variable, treatment as the row variable, and response as the column variable. PROC FREQ handles ties by assigning midranks to tied response values. If there are multiple subjects per treatment in each block, the ANOVA CMH statistic is a generalization of Friedman's test.
The data set Hypnosis contains data from a study investigating whether hypnosis has the same effect on skin potential (measured in millivolts) for four emotions (Lehmann 1975, p. 264). Eight subjects are asked to display fear, joy, sadness, and calmness under hypnosis. The data are recorded as one observation per subject for each emotion.
data Hypnosis; length Emotion $ 10; input Subject Emotion $ SkinResponse @@; datalines; 1 fear 23.1 1 joy 22.7 1 sadness 22.5 1 calmness 22.6 2 fear 57.6 2 joy 53.2 2 sadness 53.7 2 calmness 53.1 3 fear 10.5 3 joy 9.7 3 sadness 10.8 3 calmness 8.3 4 fear 23.6 4 joy 19.6 4 sadness 21.1 4 calmness 21.6 5 fear 11.9 5 joy 13.8 5 sadness 13.7 5 calmness 13.3 6 fear 54.6 6 joy 47.1 6 sadness 39.2 6 calmness 37.0 7 fear 21.0 7 joy 13.6 7 sadness 13.7 7 calmness 14.8 8 fear 20.3 8 joy 23.6 8 sadness 16.3 8 calmness 14.8 ;
In the following statements, the TABLES statement creates a three-way table stratified by Subject and a two-way table; the variables Emotion and SkinResponse form the rows and columns of each table. The CMH2 option produces the first two Cochran-Mantel-Haenszel statistics, the option SCORES=RANK specifies that rank scores are used to compute these statistics, and the NOPRINT option suppresses the contingency tables. These statements produce Output 28.8.1 and Output 28.8.2.
proc freq data=Hypnosis; tables Subject*Emotion*SkinResponse Emotion*SkinResponse / cmh2 scores=rank noprint; run;Output 28.8.1: CMH Statistics: Stratifying by Subject
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.