Skip to content

documentation for contrasts and contrasts<- (PR#607)

2 messages · Setzer.Woodrow@epamail.epa.gov, Brian Ripley

#
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Thu, 13 Jul 2000 Setzer.Woodrow@epamail.epa.gov wrote:

            
Thanks, I have written enhanced versions.
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
[,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.