#Biostatistics 321 #THREE FACTOR DESIGN WITH #ONE FACTOR NESTED INSIDE ANOTHER #FACTORS A & B ARE CROSSED FACTORS #FACTOR B IS NESTED WITHIN A #EXAMPLE FROM NETER ET AL 1990 P. 1152 NET=read.table("NKNWTA28.12.txt") NET attach(NET) A=factor(A) B=factor(B) C=factor(CinA) #ANOVA TABLE: anova(lm(Y~A*B+B:C%in%A+C%in%A)) #FROM ANOVA TABLE: MSA=420.25 MSB=182.25 MSAB=2.25 MSCinA=0.25 MSBCinA=1.25 MSE=13.25 dfA=1 dfB=1 dfAB=1 dfCinA=2 dfBCinA=2 dfE=8 alpha=0.05 #TEST FOR INDEPENDENT FACTOR A: FA=MSA/MSCinA FA CA=qf(1-alpha,dfA,dfCinA) CA PA=1-pf(FA,dfA,dfCinA) PA #TEST FOR INDEPENDENT FACTOR B: FB=MSB/MSBCinA FB CB=qf(1-alpha,dfB,dfBCinA) CA PB=1-pf(FB,dfB,dfBCinA) PB #TEST FOR INTERACTION OF FACTORS A & B: FAB=MSAB/MSBCinA FAB CAB=qf(1-alpha,dfAB,dfBCinA) CAB PAB=1-pf(FAB,dfAB,dfBCinA) PAB #TEST FOR NESTED FACTOR C SPECIFIC EFFECTS: FC=MSCinA/MSE FC CC=qf(1-alpha,dfCinA,dfE) CC PC=1-pf(FC,dfCinA,dfE) PC #TEST FOR INTERACTION OF INDEPENDENT FACTOR B WITH #NESTED FACTOR C IN A: FBC=MSBCinA/MSE FBC CBC=qf(1-alpha,dfBCinA,dfE) CBC PBC=1-pf(FBC,dfBCinA,dfE) PBC