[R] predict.mlm bug?

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Jun 25 19:48:17 CEST 2002


Paul Gilbert <pgilbert at bank-banque-canada.ca> writes:

> I believe there is a coding error in the first part of predict.mlm in the
> splines package, but perhaps someone could explain the logic to me if I'm wrong.
> I don't see how the second if (missing(newdata)) could ever be true. (I would
> show the code but I'm using email on a different machine than R today.)

It seems that you're right, unless one wants to claim that it isn't a
bug just that some code is never activated...


function (object, newdata, se.fit = FALSE, ...) 
{
    if (missing(newdata)) 
        return(object$fitted)
    if (se.fit) 
        stop("The 'se.fit' argument is not yet implemented for mlm objects")
    if (missing(newdata)) {
        X <- model.matrix(object)
        offset <- object$offset
    }
    else {
        tt <- terms(object)
        ...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list