The option `iter.max' should be an element of the Control list. If you read
the help file carefully, you would have noticed this. So, try this:
f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital, link='identity',
control=list(iter.max=200), x=TRUE, y=TRUE)
Identity link is challenging to fit computationally. Try setting
`trave=TRUE' to see the convergence of the parameters.
f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital, link='identity',
control=list(iter.max=200, trace=TRUE), x=TRUE, y=TRUE)
Ravi.
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On
Behalf Of Mike Harwood [harwood262 at gmail.com]
Sent: Sunday, May 08, 2011 9:27 AM
To: r-help at r-project.org
Subject: [R] Syntax for iter.max in rms
Hello,
I would like to increase the number of iterations for running a
Buckley-James regression model in the rms package, but something is
apparently syntactically wrong. The following code initially is
exactly as it appears in the help page (which runs successfully), then
a "failure to converge" message (resulting from specifying an
'identity' link argument, the error message by adding both the
iter.max control and 'identity' link arguments, and finally, the error
message when testing just an iter.max argument.
This was run in R 2.13.0 with rms version 3.3-0 on Ubuntu Linux 11.04.
Thank you in advance, and all insights and criticisms are appreciated.
Mike
library(rms)> f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital,x=TRUE, y=TRUE)
> f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital,
link='identity',x=TRUE, y=TRUE)
No convergence in 50 steps
Failure in bj.fit> f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital,
link='identity', iter.max=200, x=TRUE, y=TRUE)
Error in bj(Surv(ftime, stroke) ~ rcs(age, 5) + hospital, link
"identity", :
unused argument(s) (iter.max = 200)> f <- bj(Surv(ftime, stroke) ~ rcs(age,5) + hospital, iter.max=200,
x=TRUE, y=TRUE)
Error in bj(Surv(ftime, stroke) ~ rcs(age, 5) + hospital, iter.max 200, :
unused argument(s) (iter.max = 200)
______________________________________________
R-help at 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.