Martin Maechler
1997-Dec-04 17:23 UTC
R-alpha: model.matrix(.) does not allow `contrasts' ..
and this breaks multinom from the nnet library
[yes, Kurt, I'm working on that and I'll send you patches..]
Is this a bug or an (half-)intentional difference to S ?
---------------------
In R (0.50-0.60)
model.matrix(formula =, data =)
Arguments:
formula: A model formula or terms object
data: A data frame created with `model.frame'
In S-plus
USAGE:
model.matrix(object, ...)
model.matrix.default(terms.object, data, contrasts)
ARGUMENTS:
.....
contrasts: an optional list giving contrasts for some or all
of the factors appearing in the terms object. The
elements of the list should have the same name as the
variable and should be either a contrast matrix
(specifically, any full-rank matrix with as many rows as
there are levels in the factor), or else a function to
compute such a matrix given the number of levels. The
complete contrast list (anything given as an argument plus
any additional contrast matrices computed) will be
returned as the "contrasts" attribute of the model matrix,
and hence as the "contrasts" component of fitted models
returned by lm() and its descendants.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thomas Lumley
1997-Dec-04 17:41 UTC
R-alpha: model.matrix(.) does not allow `contrasts' ..
On Thu, 4 Dec 1997, Martin Maechler wrote:> and this breaks multinom from the nnet library > [yes, Kurt, I'm working on that and I'll send you patches..] > > Is this a bug or an (half-)intentional difference to S ? >I think it's a bug -- you should be able to specify contrasts on a model-by-model basis if you really want to. Fortunately it's very rare for people to use this feature. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._