[R] predict error for survreg with natural splines
Gad Abraham
g.abraham at ms.unimelb.edu.au
Wed Dec 5 00:58:15 CET 2007
Hi,
The following error looks like a bug to me but perhaps someone can shed
light on it:
> library(splines)
> library(survival)
> s <- survreg(Surv(futime, fustat) ~ ns(age, knots=c(50, 60)),
data=ovarian)
> n <- data.frame(age=rep(mean(ovarian$age), 10))
> predict(s, newdata=n)
Error in qr.default(t(const)) :
NA/NaN/Inf in foreign function call (arg 1)
Thanks,
Gad
> sessionInfo()
R version 2.6.1 (2007-11-26)
i486-pc-linux-gnu
locale:
LC_CTYPE=en_AU.UTF-8;LC_NUMERIC=C;LC_TIME=en_AU.UTF-8;
LC_COLLATE=en_AU.UTF-8;LC_MONETARY=en_AU.UTF-8;LC_MESSAGES=en_AU.UTF-8;
LC_PAPER=en_AU.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;
LC_MEASUREMENT=en_AU.UTF-8;LC_IDENTIFICATION=C
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] survival_2.34
loaded via a namespace (and not attached):
[1] rcompgen_0.1-17
--
Gad Abraham
Department of Mathematics and Statistics
The University of Melbourne
Parkville 3010, Victoria, Australia
email: g.abraham at ms.unimelb.edu.au
web: http://www.ms.unimelb.edu.au/~gabraham
More information about the R-help
mailing list