This example uses statements for the analysis of a randomized block with two treatment factors occurring in a factorial structure. The data, from Neter, Wasserman, and Kutner (1990, p. 941), are from an experiment examining the effects of codeine and acupuncture on post-operative dental pain in male subjects. Both treatment factors have two levels. The codeine levels are a codeine capsule or a sugar capsule. The acupuncture levels are two inactive acupuncture points or two active acupuncture points. There are four distinct treatment combinations due to the factorial treatment structure. The 32 subjects are assigned to eight blocks of four subjects each based on an assessment of pain tolerance.
The data for the analysis are balanced, so PROC ANOVA is used. The data are as follows:
title1 'Randomized Complete Block With Two Factors'; data PainRelief; input PainLevel Codeine Acupuncture Relief @@; datalines; 1 1 1 0.0 1 2 1 0.5 1 1 2 0.6 1 2 2 1.2 2 1 1 0.3 2 2 1 0.6 2 1 2 0.7 2 2 2 1.3 3 1 1 0.4 3 2 1 0.8 3 1 2 0.8 3 2 2 1.6 4 1 1 0.4 4 2 1 0.7 4 1 2 0.9 4 2 2 1.5 5 1 1 0.6 5 2 1 1.0 5 1 2 1.5 5 2 2 1.9 6 1 1 0.9 6 2 1 1.4 6 1 2 1.6 6 2 2 2.3 7 1 1 1.0 7 2 1 1.8 7 1 2 1.7 7 2 2 2.1 8 1 1 1.2 8 2 1 1.7 8 1 2 1.6 8 2 2 2.4 ;
The variable PainLevel
is the blocking variable, and Codeine
and Acupuncture
represent the levels of the two treatment factors. The variable Relief
is the pain relief score (the higher the score, the more relief the patient has).
The following statements invokes PROC ANOVA. The blocking variable and treatment factors appear in the CLASS
statement. The bar between the treatment factors Codeine
and Acupuncture
adds their main effects as well as their interaction Codeine
*Acupuncture
to the model.
proc anova data=PainRelief; class PainLevel Codeine Acupuncture; model Relief = PainLevel Codeine|Acupuncture; run;
The results from the analysis are shown in Output 26.1.1, Output 26.1.2, and Output 26.1.3.
Output 26.1.1: Class Level Information
Output 26.1.2: ANOVA Table
The Class Level Information and ANOVA table are shown in Output 26.1.1 and Output 26.1.2. The classification level information summarizes the structure of the design. It is good to check these consistently in search of errors in the DATA step. The overall F test is significant, indicating that the model accounts for a significant amount of variation in the dependent variable.
Output 26.1.3: Tests of Effects
Output 26.1.3 shows tests of the effects. The blocking effect is significant; hence, it is useful. The interaction between codeine and acupuncture is significant at the 90% level but not at the 95% level. The significance level of this test should be determined before the analysis. The main effects of both treatment factors are highly significant.