Setzer.Woodrow@epamail.epa.gov
2000-Jul-13 16:39 UTC
[Rd] documentation for contrasts and contrasts<- (PR#607)
The documentation (in ver 1.1) for contrasts and contrasts<- does not list all the arguments for those functions. In addition to x, the factor whose contrasts are being extracted or set, contrasts() has the argument 'contrasts=TRUE', and contrasts<-() has the argument 'how.many'. It was this latter that had me flummoxed, because I wanted to reparametrize a model by specifying a full-rank contrast matrix (fitting without an intercept). R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Biostatistics and Fax: (919) 541-4002 Research Support Staff NHEERL MD-55; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
2000-Jul-14 06:28 UTC
[Rd] documentation for contrasts and contrasts<- (PR#607)
On Thu, 13 Jul 2000 Setzer.Woodrow@epamail.epa.gov wrote:> > > The documentation (in ver 1.1) for contrasts and contrasts<- does not list all > the arguments for those functions. In addition to x, the factor whose contrasts > are being extracted or set, contrasts() has the argument 'contrasts=TRUE', and > contrasts<-() has the argument 'how.many'.Thanks, I have written enhanced versions.> > It was this latter that had me flummoxed, because I wanted to reparametrize a > model by specifying a full-rank contrast matrix (fitting without an intercept). >That happens automatically the intercept. It can't be a `contrast matrix' though, as the contrasts do not span the full space (they are orthogonal to the constant). To continue the ?contrasts example, you can do> contrasts(fff, 3) <- contr.sum(5)[,1:3] > contrasts(fff) # treatment[,1] [,2] [,3] a 1 0 0 c 0 1 0 i 0 0 1 s 0 0 0 t -1 -1 -1 to set three contrasts. You cannot set 5, though, as you can't generate them. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._