* chapter_8_table_12 The data in Table 8.12 consist of blood pressure scores for 72 participants. Three categorical independent variables: the presence and absence of biofeedback (biofeed), drug X, Y, or Z (drug), and diet absent or present (diet) have been factorially combined to form a 2 x 3 x 2 design where each person contributes one blood pressure score to one of the 12 different experimental conditions. For this example, there are 6 participants in each group; LIBNAME md 'd:\data files by type\sas data files\tables'; DATA c8t12; SET md.chapter_8_table_12; * First, the omnibus tests of interest will be computed to determine if there are differences among the groups on the mean level of blood pressure. Table 8.14 illustrates the results replicated here. The following SAS syntax is used to obtain the omnibus tests for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet; RUN; * The next analyses to be carried out are the simple interaction tests. Specifically we are interested in testing the interaction between biofeedback and drug within the diet absent and diet present conditions. The result of the analyses we are replicating are in Table 8.16. The following SAS syntax is used to obtain the simple interaction tests for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet; CONTRAST 'simple interaction test diet absent' biofeed*drug 1 -1 0 -1 1 0 biofeed*drug*diet 1 0 -1 0 0 0 -1 0 1, biofeed*drug 1 1 -2 -1 -1 2 biofeed*drug*diet 1 0 1 0 -2 0 -1 0 -1 0 2; CONTRAST 'simple interaction test diet present' biofeed*drug 1 -1 0 -1 1 0 biofeed*drug*diet 0 1 0 -1 0 0 0 -1 0 1, biofeed*drug 1 1 -2 -1 -1 2 biofeed*drug*diet 0 1 0 1 0 -2 0 -1 0 -1 0 2; RUN; * One might also be interested in testing the simple, simple main effects within a particular condition of diet. Here we are interested in the simple, simple main effects of both biofeedback and drug within the diet absent condition. The following syntax produces the results contained in Table 8.17 and also produces the corresponding confidence intervals illustrated in Table 8.21. Note that the confidence intervals can be multiplied by -1 to literally match the results obtained in the book. This is due to arbitrarily assigning which mean is to be subtracted from the other. The following SAS syntax is used to obtain the simple, simple main effect tests and confidence intervals for biofeedback within specific levels of drug and when diet is absent for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet /CLPARM; CONTRAST 'biofeedback w drug X, diet absent' biofeed 1 -1 biofeed*drug 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 1 0 0 0 0 0 -1; ESTIMATE 'biofeedback w drug X, diet absent' biofeed 1 -1 biofeed*drug 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 1 0 0 0 0 0 -1; CONTRAST 'biofeedback w drug Y, diet absent' biofeed 1 -1 biofeed*drug 0 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 0 0 1 0 0 0 0 0 -1; ESTIMATE 'biofeedback w drug Y, diet absent' biofeed 1 -1 biofeed*drug 0 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 0 0 1 0 0 0 0 0 -1; CONTRAST 'biofeedback w drug Z, diet absent' biofeed 1 -1 biofeed*drug 0 0 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 0 0 0 0 1 0 0 0 0 0 -1; ESTIMATE 'biofeedback w drug Z, diet absent' biofeed 1 -1 biofeed*drug 0 0 1 0 0 -1 biofeed*diet 1 0 -1 biofeed*drug*diet 0 0 0 0 1 0 0 0 0 0 -1; RUN; * The following SAS syntax is used to obtain the simple, simple main effect tests for drug within specific levels of biofeedback and when diet is absent for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet; CONTRAST 'drug w biofeedback present, diet absent' drug 1 -1 biofeed*drug 0 0 0 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 0 0 0 0 0 0 1 0 -1,drug 1 1 -2 biofeed*drug 0 0 0 1 1 -2 drug*diet 1 0 1 0 -2 biofeed*drug*diet 0 0 0 0 0 0 1 0 1 0 -2; CONTRAST 'drug w biofeedback absent, diet absent' drug 1 -1 biofeed*drug 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 1 0 -1, drug 1 1 -2 biofeed*drug 1 1 -2 drug*diet 1 0 1 0 -2 biofeed*drug*diet 1 0 1 0 -2; RUN; * More specific mean comparisons may also be of interest. For the numerical example, we compare individual cell means for the drugs when biofeedback is either present or absent and diet is absent. We begin with the individual cell mean comparisons when biofeedback is present. The syntax to follow generates the results shown in Table 8.18. We also provide confidence intervals similar to the intervals shown in Table 8.22. There is one important difference between the confidence intervals reported here and the intervals shown in Table 8.22, however. The intervals reported here do not use a multiple comparison procedure, while Table 8.22 uses the Tukey HSD multiple comparison procedure. As of this writing, it is not possible to directly obtain the correct Tukey HSD confidence intervals for this more complex analysis. One could obtain the Tukey intervals by hand through using the parameter estimates and standard errors shown along with obtaining the appropriate critical value to form the Tukey HSD confidence intervals. The following SAS syntax is used to obtain the tests and confidence intervals for individual cell mean comparisons between levels of drug when biofeedback is present and diet is absent for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet /CLPARM; CONTRAST 'drug X vs drug Y, biofeedback present, diet absent' drug 1 -1 biofeed*drug 0 0 0 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 0 0 0 0 0 0 1 0 -1; ESTIMATE 'drug X vs drug Y, biofeedback present, diet absent' drug 1 -1 biofeed*drug 0 0 0 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 0 0 0 0 0 0 1 0 -1; CONTRAST 'drug X vs drug Z, biofeedback present, diet absent' drug 1 0 -1 biofeed*drug 0 0 0 1 0 -1 drug*diet 1 0 0 0 -1 biofeed*drug*diet 0 0 0 0 0 0 1 0 0 0 -1; ESTIMATE 'drug X vs drug Z, biofeedback present, diet absent' drug 1 0 -1 biofeed*drug 0 0 0 1 0 -1 drug*diet 1 0 0 0 -1 biofeed*drug*diet 0 0 0 0 0 0 1 0 0 0 -1; CONTRAST 'drug Y vs drug Z, biofeedback present, diet absent' drug 0 1 -1 biofeed*drug 0 0 0 0 1 -1 drug*diet 0 0 1 0 -1 biofeed*drug*diet 0 0 0 0 0 0 0 0 1 0 -1; ESTIMATE 'drug Y vs drug Z, biofeedback present, diet absent' drug 0 1 -1 biofeed*drug 0 0 0 0 1 -1 drug*diet 0 0 1 0 -1 biofeed*drug*diet 0 0 0 0 0 0 0 0 1 0 -1; RUN; * The following SAS syntax is used to obtain the tests and confidence intervals for individual cell mean comparisons between levels of drug when biofeedback is absent and diet is absent for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet /CLPARM; CONTRAST 'drug X vs drug Y, biofeedback present, diet absent' drug 1 -1 biofeed*drug 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 1 0 -1; ESTIMATE 'drug X vs drug Y, biofeedback present, diet absent' drug 1 -1 biofeed*drug 1 -1 drug*diet 1 0 -1 biofeed*drug*diet 1 0 -1; CONTRAST 'drug X vs drug Z, biofeedback present, diet absent' drug 1 0 -1 biofeed*drug 1 0 -1 drug*diet 1 0 0 0 -1 biofeed*drug*diet 1 0 0 0 -1; ESTIMATE 'drug X vs drug Z, biofeedback present, diet absent' drug 1 0 -1 biofeed*drug 1 0 -1 drug*diet 1 0 0 0 -1 biofeed*drug*diet 1 0 0 0 -1; CONTRAST 'drug Y vs drug Z, biofeedback present, diet absent' drug 0 1 -1 biofeed*drug 0 1 -1 drug*diet 0 0 1 0 -1 biofeed*drug*diet 0 0 1 0 -1; ESTIMATE 'drug Y vs drug Z, biofeedback present, diet absent' drug 0 1 -1 biofeed*drug 0 1 -1 drug*diet 0 0 1 0 -1 biofeed*drug*diet 0 0 1 0 -1; RUN; * The final statistical tests to be illustrated here are simple main effects. Specifically, the tests of interest are the simple main effect of biofeedback when diet is present (averaging over the levels of drug) and the simple main effect of drug when diet is present (averaging over the levels of biofeedback). The results obtained here duplicate the results illustrated in Table 8.19. Note that in the SAS "slice" output, the second row of results corresponds to the diet present condition. Also, the "drug*diet" table contains the simple main effects of drug at specific levels of diet, while the "biofeed*diet" table contains the simple main effects of biofeedback at specific levels of diet. Further, the confidence interval for the simple main effect of biofeedback within the diet present condition is replicated here through an estimate statement. It should be noted that the confidence interval should be multiplied by -1 to literally replicate the results in Table 8.21 for the same reason mentioned earlier in the section on simple, simple main effects. The following SAS syntax is used to obtain the simple main effects of biofeedback and drug when diet is present and the confidence interval for the simple main effect of biofeedback when diet is present for the data in Chapter 8, Table 12; PROC GLM; CLASS biofeed drug diet; MODEL bp = biofeed|drug|diet /CLPARM; LSMEANS biofeed*diet/SLICE=diet; LSMEANS drug*diet/SLICE=diet; ESTIMATE 'simple main effect of biofeedback when diet is present' biofeed 3 -3 biofeed*drug 1 1 1 -1 -1 -1 biofeed*diet 0 3 0 -3 biofeed*drug*diet 0 1 0 1 0 1 0 -1 0 -1 0 -1 /DIVISOR=3; RUN;