Dear colleagues, I'd very much appreciate your help in resolving a problem that I'm having with plotting a spline term.
I have a Cox PH model including a smoothing spline and a frailty term as follows: fit<-coxph(Surv(start,end,exit) ~ x + pspline(z) + frailty(a)) When I run a model without a frailty term, I use the following in order to plot the splines: termplot(fit, term = 2, se = TRUE, ylab = "Log Hazard", rug=TRUE, xlab = "z_name") However, when the frailty term is included, it gives this error: Error in pred[, first] : subscript out of bounds What am I doing wrong here? Or is it the case that termplot does not work when splines and frailty are included? A similar question was asked a number of years ago - as far as I can see it didn't receive an answer (online, at least). http://r.789695.n4.nabble.com/a-question-in-coxph-td908035.html Best, Conor Little Conor Little Postdoctoral Researcher Department of Political Science, University of Copenhagen [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.