Skip to content

Bug in model.matrix.default (was: [R] predict incosistency ?) (PR#1100)

1 message · Duncan Murdoch

#
On Tue, 25 Sep 2001 12:27:27 GMT, Jorge Luis Ojeda Cabrera
<jojeda@posta.unizar.es> wrote in message
<20010925.12272700@macdesp8.unizar.es>:
It still appears in 1.3.1, I think it's a bug.  It shows up when you
use the newdata parameter to predict.lm; if you just ask for
predictions without specifying the x value things are fine:
1        2        3        4        5 
0.486269 0.486269 0.486269 0.486269 0.486269
Error in model.matrix.default(delete.response(tt), newdata, contrasts
= object$contrasts,  : 
        subscript out of bounds

There are 3 lines in model.matrix.default that assume that there is at
least one predictor in the model:  they index various things by "-1"
to remove it.  I can't follow what's going on there well enough to fix
it.

Duncan Murdoch

Version:
 platform = i386-pc-mingw32
 arch = x86
 os = Win32
 system = x86, Win32
 status = 
 major = 1
 minor = 3.1
 year = 2001
 month = 08
 day = 31
 language = R

Windows 98 4.10 (build 1998)  

Search Path:
 .GlobalEnv, package:ctest, Autoloads, package:base


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._