On Nov 17, 2010, at 1:05 PM, Federico Calboli wrote:

Hi All,

I am trying to figure out how to get the position of the knots in a pspline used in a cox model.

As far as I understand it, the term "knot" should be used with natural splines, but not for penalized smoothing splines. See p 124 of Therneau and Gramsch for better description and illustrations. If you want to see the weighting of a particular pspline then this example may help:

nn=rnorm(20)
matrix(pspline(nn), nrow=20)[order(nn), ]
# sorts the spline basis weights so the overlap is "visible"

--
David.


my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous

How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot.

Best,

Federico

--
Federico C. F. Calboli
Department of Epidemiology and Biostatistics
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG

Tel +44 (0)20 75941602   Fax +44 (0)20 75943193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

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

David Winsemius, MD
West Hartford, CT

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

Reply via email to