Charles C. Berry wrote: > On Wed, 5 Dec 2007, Gad Abraham wrote: > >> 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 > > Gad, > > I think I have it now. > > survreg does not automatically place the boundary knots in its $terms > component. > > You can force this by hand:
Thanks Chuck and Moshe, manually setting the boundary fixes the problem. Cheers, Gad -- Gad Abraham Department of Mathematics and Statistics The University of Melbourne Parkville 3010, Victoria, Australia email: [EMAIL PROTECTED] web: http://www.ms.unimelb.edu.au/~gabraham ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.