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. The first value is the observed cell count, the second value is the expected cell count assuming independence , and the third value is their difference, which is sometimes called the "deviation.
|Published (Last):||27 October 2005|
|PDF File Size:||11.16 Mb|
|ePub File Size:||6.6 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
SAS Chi-Square Test – SAS PROC FREQ
SAS - Chi Square
The FREQ Procedure