Dr Shen Even though you pose 3 contrasts, there are only 2 degrees of freedom as the 3rd contrast is the sum of the first two. Your aov output states this as StdLot has only 2 df. Having used up your df, the aov has nothing to report.
Joe Joseph F. Lucke Senior Statistician Research Institute on Addictions State University of New York at Buffalo 1021 Main Street Buffalo, NY 14203-1016 Office: 716-887-6807 Fax: 716-887-2510 http://www.ria.buffalo.edu/profiles/lucke.html Jun Shen <[email protected]> Sent by: [email protected] 08/19/2009 05:33 PM To [email protected] cc Subject [R] Contrasts within ANOVA frame (Repost) Would like to try my luck to see if I can catch your eyes. I was trying to do some contrasts within ANOVA. I searched the archive and found a clue posted by Steffen Katzner ( http://tolstoy.newcastle.edu.au/R/help/06/01/19385.html) I have three levels for a factor names "StdLot" and want to make three comparisons, 1 vs 2, 1 vs 3 and 2 vs 3. First, contrasts(d3$StdLot,3)<-matrix(c(1,-1, 0,0,1,-1,1,0,-1),3,3) #d3 is the data set. set up the contrast matrix Second, aov(Bkg~StdLot,na.rm=T,data=d3,contrasts=contrasts(d3$StdLot))->mod.aov #ANOVA, Finally, summary(mod.aov,split=list(StdLot=list('1 vs 2'=1,'2 vs 3'=2,'1 vs 3'=3))) #comparison summary Here is the final result I got, the third comparison is missing. Does anyone have any idea what is wrong here? If I change the order of the comparisons it's always the third one missing. So I guess it's not due to the data. Appreciate any comment. Df Sum Sq Mean Sq F value Pr(>F) StdLot 2 1.905 0.953 10.3769 3.710e-05 *** StdLot: 1 vs 2 1 0.223 0.223 2.4239 0.1200 StdLot: 2 vs 3 1 1.683 1.683 18.3299 2.162e-05 *** StdLot: 1 vs 3 1 Residuals 601 55.173 0.092 --- Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1 2 observations deleted due to missingness -- Jun Shen PhD PK/PD Scientist BioPharma Services Millipore Corporation 15 Research Park Dr. St Charles, MO 63304 Direct: 636-720-1589 [[alternative HTML version deleted]] ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

