* ------ problem 11.1 ------------------------------------------------ ; data tableex ; input trtcomb $ A B C D @@ ; I = 1 ; AB = A*B ; AC = A*C ; AD = A*D ; BC = B*C ; BD = B*D ; CD = C*D ; ABC = A*B*C ; ABD = A*B*D ; ACD = A*C*D ; BCD = B*C*D ; ABCD = A*B*C*D ; cards ; (1) -1 -1 -1 -1 a 1 -1 -1 -1 b -1 1 -1 -1 ab 1 1 -1 -1 c -1 -1 1 -1 ac 1 -1 1 -1 bc -1 1 1 -1 abc 1 1 1 -1 d -1 -1 -1 1 ad 1 -1 -1 1 bd -1 1 -1 1 abd 1 1 -1 1 cd -1 -1 1 1 acd 1 -1 1 1 bcd -1 1 1 1 abcd 1 1 1 1 ; proc print data = tableex noobs ; var trtcomb I A B C D AB AC AD BC BD CD ABC ABD ACD BCD ABCD ; run ; /* So the + block contains : (1), ab, ac, ad, bc, bd, cd, abcd the - block contains : a, b, c, d, abc, abd, acd, bcd Note that even numbers of factors are + while odd numbers are - */ * ------ problem 11.7 ------------------------------------------------ ; data prob117 ; input rep day a b c d y @@ ; cards ; 1 1 0 0 0 0 40 1 1 1 1 0 0 33 1 1 1 0 1 0 31 1 1 0 1 1 0 38 1 1 1 0 0 1 22 1 1 0 1 0 1 37 1 1 0 0 1 1 49 1 1 1 1 1 1 30 1 2 1 0 0 0 24 1 2 0 1 0 0 31 1 2 0 0 1 0 27 1 2 1 1 1 0 23 1 2 0 0 0 1 48 1 2 1 1 0 1 35 1 2 1 0 1 1 29 1 2 0 1 1 1 37 2 3 0 0 0 0 43 2 3 1 1 0 0 30 2 3 1 0 1 0 30 2 3 0 1 1 0 32 2 3 1 0 0 1 26 2 3 0 1 0 1 33 2 3 0 0 1 1 40 2 3 1 1 1 1 31 2 4 1 0 0 0 28 2 4 0 1 0 0 35 2 4 0 0 1 0 28 2 4 1 1 1 0 20 2 4 0 0 0 1 44 2 4 1 1 0 1 36 2 4 1 0 1 1 25 2 4 0 1 1 1 34 ; proc glm data = prob117 ; class rep day a b c d ; model y = rep day(rep) a|b|c|d @3 ; lsmeans a b c d a*b / stderr pdiff cl ; * these three ESTIMATE statements illustrate one way to calculate effects ; estimate 'a main effect' a 1 -1 ; estimate 'a*b interaction' a*b .5 -.5 -.5 .5 ; estimate 'a*b*c interaction' a*b*c .25 -.25 -.25 .25 -.25 .25 .25 -.25 ; lsmeans a*b*c a*b*d ; output out = rprob117 r = resid p = pred ; run ; * check assumptions ; proc plot data = rprob117 ; plot resid*pred ; proc capability noprint data = rprob117 lineprinter ; var resid ; qqplot resid /normal(mu = est sigma = est symbol='.') square ; run ; *one way to examine a three way interaction ; proc print data = rprob117 ; run ; proc sort data = rprob117 ; by d ; run ; proc plot data = rprob117 ; plot pred*a=b ; by d ; run ; *a different way: re-enter information from LSMEANS here ; data interabc ; input a b c ymean ; cards ; 0 0 0 43.7500000 0 0 1 36.0000000 0 1 0 34.0000000 0 1 1 35.2500000 1 0 0 25.0000000 1 0 1 28.7500000 1 1 0 33.5000000 1 1 1 26.0000000 ; proc sort data = interabc ; by c ; proc plot data = interabc vpercent = 50 hpercent = 50 ; plot ymean*a=b ymean*b=a ; by c ; data interabd ; input a b d ymean ; cards ; 0 0 0 34.5000000 0 0 1 45.2500000 0 1 0 34.0000000 0 1 1 35.2500000 1 0 0 28.2500000 1 0 1 25.5000000 1 1 0 26.5000000 1 1 1 33.0000000 ; proc sort data = interabd ; by d ; proc plot data = interabd vpercent = 50 hpercent = 50 ; plot ymean*a=b ymean*b=a ; by d ; run ; * ------ problem 12.2 ------------------------------------------------ ; /* a. By the same reasoning used in Table 11.3, in a fractional factorial using I = ABCDE, treatment combinations with an odd number of the five factors will have a '+' sign, so the 16 combinations with an odd number of factors are: A, B, C, D, E, ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, BDE, CDE, ABCDE this design has resolution five because main effects are only aliased with four way interactions and two-way interactions are only aliased with three-way interactions b. Using generalized interactions, the alias structure is: A, BCDE AB, CDE B, ACDE AC, BDE C, ABDE AD, BCE D, ABCE AE, BCD E, ABCD BC, ADE BD, ACE BE, ACD CD, ABE CE, ABD DE, ABC */