From raising.1606 at gmail.com Fri Jul 14 12:35:38 2017 From: raising.1606 at gmail.com (raising) Date: Fri, 14 Jul 2017 03:35:38 -0700 (PDT) Subject: [datatable-help] Nomogram with time-dependent cox model Message-ID: <1500028538610-4741750.post@n4.nabble.com> Hi R users, I encounter a problem that I failed to produce nomogram of a time-dependent Cox survival model. The simplified R code is as the follows: fit <- cph(Surv(Start, Stop, Event) ~ x1 + x2 + x3, x = TRUE, y = TRUE, surv = TRUE) So far it works well, I can get the parameter estimates accurately. Then I try to generate a nomogram: med <- Quantile(fit) surv <- Survival(fit) # This would also work if f was from cph nom <- nomogram(fit, fun=list(function(x) surv(180, x), function(x) surv(365, x), function(x) surv(1095, x)), fun.at = c(.001, .05, .2,seq(0,1,by=.2),.8,.9, .95, .99), funlabel=c("6-month Survival", "1-Year Survival", "3-Year Survival"), lp=FALSE, vnames = "labels") plot(nom,xfrac=.25, naxes=10) I get an error message as the follows: Error in approx(fu[s], xseq[s], fat, ties = mean) : need at least two non-NA values to interpolate Error in plot(nom, xfrac = 0.25, naxes = 10) : object 'nom' not found How do I successfully to obtain a nomogram of such a time-dependent Cox survival model? In addition, I also failed to get a ?calibration? plot in this time-dependent Cox survival model, the R code is: cal <- calibrate (fit, B=20 , u=439) plot(cal) I get an error message as the follows: Error in polspline::hare(S[, 1], S[, 2], fun(curtail(est.surv)), maxdim = maxdim, : not enough data In addition: Warning messages: 1: In datadist(survival) : survival is constant 2: In Surv(y[, 1], y[, 2]) : Invalid status value, converted to NA Error in plot(cal) : object 'cal' not found Thanks for your help. -- View this message in context: http://r.789695.n4.nabble.com/Nomogram-with-time-dependent-cox-model-tp4741750.html Sent from the datatable-help mailing list archive at Nabble.com. From tangzhenchao_sdu at 126.com Wed Jul 26 18:11:30 2017 From: tangzhenchao_sdu at 126.com (Zhenchao Tang) Date: Wed, 26 Jul 2017 09:11:30 -0700 (PDT) Subject: [datatable-help] Need help on the Lasso cox model with discrete time Message-ID: <1501085490940-4742822.post@n4.nabble.com> Hi everyone, We have been trying to construct a Lasso-cox model with discrete time. We conducted follow-up examinations on the epileptic attack after tumor surgical resection among glioma patients. The patients are followed-up in the 6/12/24 months after surgical resection, which makes the epilepsy-free time discrete (6/12/24 months). We calcluated many features from the T2-images obtained prior to the surgical resection. We aimed to used the image features to conducted a cox proportional hazards analysis on the epilepsy-free time in R. Hereby, We have three questions: 1. Is the cox proportional hazards analysis appropriate for our study? 2. The epilepsy-free time is discrete. We suppose that we need to conduct a cox analysis with discrete time. Is that right? 3. We acquired quite a lot image features, which makes the feature selection imperative. We have planned to use the Lasso penalty for feature selection. We notice that the 'coxnet'/'glmnet'/'penalized' package could be used to construct the Lasso-cox model. Are they still appropriate for the cox analysis with discrete time? Sorry for the poor English expression. We're still new to R. We're very grateful for any help. Thank you very much! Best Regard, Zhenchao Tang CAS Key Laboratory of Molecular Imaging, Institute of Automation,Beijing 100190, China -- View this message in context: http://r.789695.n4.nabble.com/Need-help-on-the-Lasso-cox-model-with-discrete-time-tp4742822.html Sent from the datatable-help mailing list archive at Nabble.com.