* chapter_16_table_4 The hypothetical data contained in Table 16.4 is supposed to represent the data from 29 children who participated in a study to evaluate the effectiveness of an intervention designed to increase inductive reasoning skills. The data consists of children who are nested within one of six classrooms, where each classroom contained students from both the control and the experimental condition. The question of interest is whether or not the children who participated in the experimental group actually improved their cognitive reasoning ability. Because Chapter 15 provides all of the SAS syntax necessary to replicate the results given in the chapter, and because explanations of the syntax is also given in the text, most of the code given below is taken directly from the chapter without explanations of the commands and optional specifications. ; LIBNAME md 'd:\data files by type\sas data files\tables'; Data c16t4; SET md.chapter_16_table_4_; *The following line centers the cog variable by subtracting the mean of the cog scores from the cog scores themselves. To avoid confusion we rename the centered cog scores as cogcent; cogcent = cog-49.7241379; PROC MIXED; CLASS room cond; MODEL induct = cond / SOLUTION; RANDOM int / SUBJECT=room(cond); estimate 'Condition' cond -1 1; RUN; PROC MIXED; CLASS room cond; MODEL induct = cond skill / SOLUTION; RANDOM int / SUBJECT=room(cond); estimate 'Condition' cond -1 1; RUN; *Notice the TYPE=UN included in the PROC MIXED syntax below. Recall TYPE=UN allows all of the the covariance parameters to be estimated. In this case not only are the variances of the intercept and the slope for cogcent freely estimated, so too is the covariance between them; PROC MIXED; CLASS room cond; MODEL induct = cond cogcent cond*cogcent / SOLUTION; RANDOM int cogcent / SUBJECT=room(cond) TYPE=UN; estimate 'Condition' cond -1 1; RUN;