When the computation requires column statistics, the SQL procedure is also useful. I was reminded of this fact recently when a SAS programmer possibly a student asked how to "manually" perform the classic chi-square test for association in a two-way frequency table. The computation requires computing the means across rows and down columns, and the student was struggling with implementing the computations in the DATA step. The data shows the hair color and eye color of European children.
|Published (Last):||3 March 2015|
|PDF File Size:||19.24 Mb|
|ePub File Size:||16.48 Mb|
|Price:||Free* [*Free Regsitration Required]|
Each block of the design might be a subject or a homogeneous group of subjects. If blocks are groups of subjects, the number of subjects in each block must equal the number of treatments. Treatments are randomly assigned to subjects within each block. If there is one subject per block, then the subjects are repeatedly measured once under each treatment.
The order of treatments is randomized for each subject. The three-way table uses subject or subject group as the stratifying variable, treatment as the row variable, and response as the column variable.
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 , p. 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.
These statements produce Output The -value of 0. Thus, adjusting for subject is critical to reducing the background variation due to subject differences. Output
The FREQ Procedure
SAS - Chi Square