Greg Snow a écrit : > One approach is to create your own contrasts matrix: > > >> mycmat <- diag(8) >> mycmat[ row(mycmat) == col(mycmat) + 1 ] <- -1 >> mycmati <- solve(mycmat) >> contrasts(agefactor) <- mycmati[,-1] >> > > Now when you use agefactor, the intercept will be the first age group and the > slopes will be the differences between the pairs of groups (make sure that > the order of the levels of agefactor is correct). > > The difference between this method and the contr.sdif function in MASS is how > the intercept will end up being interpreted (and the dimnames). > > Hope this helps, > >
Actually, exactly what I needed including the reference to contr.sdif in MASS I did not spot before (although I am a faithful reader of the yellow book... but so many things still escape to me). Again thanks a lot. Patrick [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org 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.