#NESTED ANOVA require(car) #READ STRUCTURED DATA TABLE WITH NUMERIC CODED FACTOR K=read.table("c:/2008LinearModelsData/TrainingSchoolR.txt") K attach(K) Y=Score A=factor(School) B=factor(Instructor) contrasts(A)=contr.sum contrasts(B)=contr.sum FM=lm(Y~A+B%in%A) anova(FM) Anova(FM, type="3") detach(K)