/* SAS Example of the Single-Factor ANOVA model */ /* We will analyze the Kenton Foods data from the example in class */ /* The response variable is sales and the factor is package design. */ /* The store label is also given in the data set. */ DATA kenton; INPUT SALES DESIGN STORE; cards; 11 1 1 17 1 2 16 1 3 14 1 4 15 1 5 12 2 1 10 2 2 15 2 3 19 2 4 11 2 5 23 3 1 20 3 2 18 3 3 17 3 4 27 4 1 33 4 2 22 4 3 26 4 4 28 4 5 ; run; /* PROC GLM will do a standard analysis of variance */ /* We specify that DESIGN is a (qualitative) factor with a CLASS statement */ /* The model statement specifies that SALES is the response */ /* and DESIGN is the factor. */ PROC GLM DATA = kenton; CLASS DESIGN; MODEL SALES = DESIGN; LSMEANS DESIGN; run; /* The ANOVA table is given for us. Pick out SSTR, SSE, SSTO, and MSTR and MSE. */ /* Notice the F* for the test for equality of factor level means is 18.59. */ /* The associated P-value for this test is less than 0.0001. */ /* The LSMEANS statement gives us the sample mean response for each of the */ /* four designs. Compare the output to the table on page 688 of the book. */ /* *********************************************************************************** */