Re: [R] Cox Proportional Hazard with missing covariate data
(1) Makes sense. Another approach is to use the time since study entry and include the age of the part in the model. A related discussion here: http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9831.html (2) It is left-truncation. A part is observed only if it has survived until study entry. Of course, if you reset the clock at study entry, there's no delayed entries anymore. Philipp Rappold wrote: Hi, Arthur, thanks a lot for your super-fast reply! In fact I am using the time when the part has been used for the first time, so your example should work in my case. Moreover, as I have time-variant covariates, the example should look like this in my specific case: start stopstatus temphumid 5 6 0 32 43 6 7 1 34 42 Just two more things: (1) I am quite a newbie to cox-regression, so I wonder what you think about the approach that I mentioned above? Don't worry, I won't nail you down to this, just want to make sure I am not totally off track! (2) I don't think that you'd call this left-truncated observations, because I DO know the time when the part was used for the first time, I just don't have covariate values for its whole time of life, e.g. just the last two years in the example above. Left truncation in my eyes would mean that I did not even observe a specific part, e.g. because it has died before the study started. Again, thanks a lot, I'll be happy to provide valuable help on this list as soon as my R-skills are advancing. All the best Philipp Arthur Allignol wrote: Hi, In fact, you have left-truncated observations. What timescale do you use, time 0 is the study entry, or when the wear-part has been used for the first time? If it is the latter, you can specify the age of the wear part at study entry in Surv(). For example, if a wear part has been used for 5 years before study entry, and dies 2 years after, the data will look like that: start stop status 57 1 Hope this helps, Arthur Allignol Philipp Rappold wrote: Dear friends, I have used R for some time now and have a tricky question about the coxph-function: To sum it up, I am not sure whether I can use coxph in conjunction with missing covariate data in a model with time-variant covariates. The point is: I know how old every piece that I oberserve is, but do not have fully historical information about the corresponding covariates. Maybe you have some advice for me, although this problem might only be 70% R and 30% statistically-related. Here's a detailled explanation: SITUATION OBJECTIVE: I want to analyze the effect of environmental effects (i.e. temperature and humidity) on the lifetime of some wear-parts. The study should be conducted on a yearly basis, meaning that I have collected empirical data on every wearpart at the end of every year. DATA: I have collected the following data: - Status of the wear-part: Equals 0 if part is still alive, equals 1 if part has died (my event variable) - Environmental data: Temperature and humidity have been measured at each of the wear-parts on a yearly basis (because each wear-part is at a different location, I have different data for each wear-part) PROBLEM: I started collecting data between 2001 and 2007. In 2001, a vast amount of of wearparts has already been in use. I DO KNOW for every part how long it has been used (even if it was employed before 2001), but I DO NOT have any information about environmental conditions like temperature or humidity before 2001 (I call this semi-left-censored). Of course, one could argue that I should simply exclude these parts from my analysis, but I don't want to loose valuable information, also because the amount of new parts that have been employed between 2001 and 2007 is rather small. Additionally, I cannot make any assumption about the underlying lifetime distribution. Therefore I have to use a non-parametrical model for estimation (most likely cox). QUESTION: From an econometric perspective, is it possible to use Cox Proportional Hazard model in this setting? As mentioned before, I have time-variant covariates for each wearpart, as well as what I call semi-left-censored data that I want to use. If not, what kind of analysis would you suggest? Thanks a lot for your great help, I really appreciate it. All the best Philipp __ 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. __ 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.
Re: [R] Competing risks Kalbfleisch Prentice method
I don't think there is a package to do that. But you could have a look at ?predict.crr. Best regards, Arthur Allignol Eleni Rapsomaniki wrote: Dear R users I would like to calculate the Cumulative incidence for an event adjusting for competing risks and adjusting for covariates. One way to do this in R is to use the cmprsk package, function crr. This uses the Fine Gray regression model. However, a simpler and more classical approach would be to implement the Kalbfleisch Prentice method (1980, p 169), where one fits cause specific cox models for the event of interest and each type of competing risk, and then calculates incidence based on the overall survival. I believe that this is what the cuminc function in the aforementioned package does, but it does not allow to adjust for a vector of covariates. My question is, is there an R package that implements the Kalbfleisch Prentice method for competing risks with covariates? for example, if k1 is the cause of interest among k competing causes: P_k1(t; x)=P(T=t, cause=k1|x)=Sum(u=0, ..., u=t) {hazard_k(u;x)*S(u;x)} where S(u;x) = exp{-sum_of_k(sum(hazard_k(u))} I have searched extensively for an implementation of this in many packages, but it appears that more complex approaches are more commonly implemented, such as timereg package. Eleni Rapsomaniki Research Associate Strangeways Research Laboratory Department of Public Health and Primary Care University of Cambridge [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] Competing risks adjusted for covariates
You could try the prodlim package. Best regards, Arthur Allignol On Fri, 27 Feb 2009 19:36:31 - Eleni Rapsomaniki er...@medschl.cam.ac.uk wrote: Dear R-users Has anybody implemented a function/package that will compute an individual's risk of an event in the presence of competing risks, adjusted for the individual's covariates? The only thing that seems to come close is the cuminc function from cmprsk package, but I would like to adjust for more than one covariate (it allows you to stratify by a single grouping vector). Any help/tips will be extremely appreciated. Eleni Rapsomaniki Research Associate Cambridge [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] Survival-Analysis: How to get numerical values from survfit (and not just a plot)?
Hi, See ?survfit.object if fit is the object you get using survfit, fit$surv will give you the survival probability. Best, arthur Bernhard Reinhardt wrote: Hi! I came across R just a few days ago since I was looking for a toolbox for cox-regression. I´ve read Cox Proportional-Hazards Regression for Survival Data Appendix to An R and S-PLUS Companion to Applied Regression from John Fox. As described therein plotting survival-functions works well (plot(survfit(model))). But I´d like to do some manipulation with the survival-functions before plotting them e.g. dividing one survival-function by another. survfit() only returns an object of the following structure n events median 0.9LCL 0.9UCL 55.000 55.000 1.033 0.696 1.637 Can you tell me how I can calculate a survival- or baseline-function out of these values and how I extract the values from the object? I´m sure the calculation is done by the corresponding plot-routine, but I couldn´t find that one either. Regards Bernhard __ 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. __ 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.
Re: [R] controlling axes in plot.cuminc (cmprsk library)
Hi, You could try to use the option xaxt = n in plot.cuminc, instead of axes. Hope that helps, Arthur Amy Krambrink wrote: Dear R-help list members, I am trying to create my own axes when plotting a cumulative incidence curve using the plot.cuminc function in the CMPRSK library. The default x-axis places tick marks and labels at 0, 20, 40, 60, and 80 (my data has an upper limit of 96), whereas I want them at my own specified locations. Here is my example code: library(cmprsk) attach(MYDATA) MYCUMINC - cuminc(ftime=TIME,fstatus=STATUS,group=GROUP,rho=0,cencode=0,na.action=na.omit) plot(MYCUMINC,xlim=c(0,96),ylim=c(0,0.5),xlab=,axes=F) axis(1,at=c(0,8,16,24,32,48,72,96)) As you can see, I have tried using the axes=F parameter that works for most plotting functions, but I get the following error message: Error in legend(wh[1], wh[2], legend = curvlab, col = color, lty = lty, : unused argument(s) (axes ...) Is there anyway I can get a customized x-axis when using the plot.cuminc function? I have searched online and R help manuals to no avail and would GREATLY appreciate your input. Please let me know if you need additional info from me. Thanks, Amy [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] Error in Comprting Risks Regression
Hi, That will be difficult to help with the little information you gave. Please read the posting guide and what's at the bottom of this email. Best regards, Arthur Allignol kende jan wrote: Dear All, I am trying to run the following function (a CRR=Competing Risks Regressionmodel) and receive the error in solve.default. Can anyone give me some insights into where the problem is? Thanks print(z-crr(J3500,CD3500,cov)) Error in solve.default(v[[1]]) : Lapack routine dgesv : system is exactly singular [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] Help on competing risk package cmprsk with time dependent covariate
Hello, Something i don't understand in your question. Is treatment a time-dependent covariate? That is, do patients receive the treatment at the beginning of the study or later? cmprsk cannot handle time-dependent covariates. But if treatment is a baseline covariate, but has a time-varying effect (i.e. does the subdistribution hazard ratio varies with time?), your solution to assess that is weird, because you will transform your baseline covariate into a time-dependent one, thus considering all the patients to receive no treatment the first year. For sure, the treatment wont have any effect for the first year. To assess a time-varying effect on competing risks, i would either follow the cmprsk documentation, including an interaction with functions of time, or use the comp.risk function in the timereg package, which fits more flexible models for the cumulative incidence functions. Best regards, Arthur Allignol Philippe Guardiola wrote: Dear R users, I d like to assess the effect of treatment covariate on a disease relapse risk with the package cmprsk. However, the effect of this covariate on survival is time-dependent (assessed with cox.zph): no significant effect during the first year of follow-up, then after 1 year a favorable effect is observed on survival (step function might be the correct way to say that ?). For overall survival analysis I have used a time dependent Cox model which has confirmed this positive effect after 1 year. Now I m moving to disease relapse incidence and a similar time dependency seems to be present. what I d like to have is that: for patients without treatment the code for treatment covariate is always 0, and for patients who received treatment covariate I d like to have it = 0 during time interval 0 to 1 year, and equal to 1 after 1 year. Correct me if I m wrong in trying to do so. First, I have run the following script (R2.7.1 under XPpro) according to previous advices: library(cmprsk) attach(LAMrelapse) fit1- crr(rel.t, rel.s, treatment, treatment, function(uft) cbind(ifelse(uft=1,1,0),ifelse(uft1,1,0)), failcode=1, cencode=0, na.action=na.omit, gtol-06, maxiter) fit1 where: rel.t = time to event (in years) rel.s = status , =1 if disease relapse, =2 if death from non disease related cause (toxicity of previous chemotherapy), =0 if alive not in relapse treatment = binary covariate (value: 0 or 1) representing the treatment to test (different from chemotherapy above, with no known toxicity) I have not yet added other covariates in the model. this script gave me the following result: fit1 - crr(relcmp.t, relcmp.s, treatment, treatment, function(uft) cbind(ifelse(uft = 1, 1, 0), ifelse(uft 1, 1, 0)), failcode = 1, cencode = 0, na.action = na.omit, gtol = 1e-006, maxiter = 10) fit1 convergence: TRUE coefficients: [1] -0.6808 0.7508 standard errors: [1] 0.2881 0.3644 two-sided p-values: [1] 0.018 0.039 ...That I dont understand at all since it looks like if treatment covariate had also a significant effect of the first period of time !? This is absolutely not the case. So I m surely wrong with a part of this script... cov2 and tf are pretty obscure for me in the help file of the package. I would really appreciate advices regarding these 2 terms. I was thinking that I might changed : cbind(ifelse(uft = 1, 1, 0), ifelse(uft 1, 1, 0) into:cbind(ifelse(uft = 1, 0, 1), ifelse(uft 1, 1, 0) But since I only have one covariate (treatment) to test, shouldnt I only write the following: fit1- crr(rel.t, rel.s, treatment, treatment, function(uft) ifelse(uft=1,0,1)), failcode=1, cencode=0, na.action=na.omit, gtol-06, maxiter) which gives me : fit1 convergence: TRUE coefficients: [1] 0.06995 -0.75080 standard errors: [1] 0.2236 0.3644 two-sided p-values: [1] 0.750 0.039 which, if I understand things correctly (I m not sure at all !) confirms that before 1 year, the effect of treatment covariate is not significant, but is significant after 1 year of follow up. But there I m again not sure of the result I obtain... any help would be greatly appreciated with cov2 and tf thanks for if you have some time for this, Philippe Guardiola _ o.fr [[alternative HTML version deleted]] __ 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. __ 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.
[R] A new task view on survival analysis
Dear all, A new task view on survival analysis is now online. It attempts to deal with all the R-packages that permit to analyze time-to-event data. Any comments or suggestions to improve the task view are very welcome. Best regards, Arthur Allignol Freiburg Center for Data Analysis and Modeling, Freiburg University, Germany __ 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.