[R] predict incosistency ?
Jorge Luis Ojeda Cabrera
jojeda at posta.unizar.es
Tue Sep 25 14:27:27 CEST 2001
When fitting model 'y~1', the 'lm' response is ok, but it is not possible
to get predictions using 'predict'. May be this is a bug, at least i
think it is somehow
inconsistent.
> rm(list=ls())
> d <- data.frame(x=runif(50),y=rnorm(50))
> plot(d)
> d.lm <- lm(y~1,data=d)
> d.lm
Call:
lm(formula = y ~ 1, data = d)
Coefficients:
(Intercept)
0.1654
> mean(d$y)
[1] 0.1654461
> predict(d.lm,data.frame(x=0.5))
Error in x[[j]] : subscript out of bounds
> predict(d.lm,data.frame(x=c(0.05,0.25,0.5)))
Error in x[[j]] : subscript out of bounds
>
I am using a little bit older version
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 2.3
year 2001
month 04
day 26
language R
>
Thanks in advance. Best, Jorge.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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