[R] Two ways to deal with age in Cox model
I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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] Two ways to deal with age in Cox model
John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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] Two ways to deal with age in Cox model
Peter, Many thanks for your prompt reply. I think you may have been too quick to dismiss model2; there is no need for time to be negative. The time parameter is Surv represents survival, i.e. follow-up time. We usually start the follow-up clock at the time a subject is enrolled into a study, but this is not the only measure of survival time. One might argue that the clock should start at birth because the subject has survived to birth to plus the time represented by the ususal follow-up clock. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Peter Dalgaard [EMAIL PROTECTED] 2/5/2007 9:16 AM John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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. Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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] Two ways to deal with age in Cox model
John Sorkin wrote: Peter, Many thanks for your prompt reply. I think you may have been too quick to dismiss model2; there is no need for time to be negative. The time parameter is Surv represents survival, i.e. follow-up time. We usually start the follow-up clock at the time a subject is enrolled into a study, but this is not the only measure of survival time. One might argue that the clock should start at birth because the subject has survived to birth to plus the time represented by the ususal follow-up clock. Yes, but your subjects logically cannot die before their recorded age if I understand the setup correctly. I.e. you have left truncation -- people who die before enrolment are not recorded at all. This is at odds with the proportional hazards assumption and it is a source of (potential) grave error if the length of the immortal period is related to the presence of the risk factor. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Peter Dalgaard [EMAIL PROTECTED] 2/5/2007 9:16 AM John Sorkin wrote: I hope one and all will allow a stats question: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, Age as a covariate: tetest1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), age= c(0, 2,1,1,1,0,0), riskfactor= c(0, 0,0,0,1,1,1)) fitagecovariate-coxph( Surv(time, status) ~ age +riskfactor, test1) fitagecovariate Age included as part of follow-up time: test2-test1 test2$timeplusage-test2$time+test2$age fitagefollowup-coxph( Surv(timeplusage, status) ~ riskfactor, test2) fitagefollowup I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. Model2 is plainly wrong, unless your times can be negative it represents long stretches of immortality (more obvious if all ages are about 80...)! Presumably, age is the age at entry, so a delayed-entry model could be appropriate (Surv(age,timeplusage,status)). If this modification is made, the main difference is that the time-since-entry scale can not (easily) have a separate effect in the delayed-entry model. If time is really is time since diagnosis or operation, then that could be badly wrong. Your thoughts please. Thanks, John R 2.1.1 windows XP John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Confidentiality Statement: This email message, including any attachments, is for the so...{{dropped}} __ R-help@stat.math.ethz.ch 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. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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] Two ways to deal with age in Cox model
On Mon, 5 Feb 2007, John Sorkin wrote: When running a cox proportional hazards model ,there are two ways to deal with age, including age as a covariate, or to include age as part of the follow-up time, viz, snip I would appreciate any thoughts about the differences in the interpretation of the two models. One obvious difference is that in the first model (fitagecovariate) one can make inferences about age and in the second one cannot. I think a second difference may be that in the first model the riskfactor is assumed to have values measured at the values of age where as in the second model riskfactor is assumed to have given values throughout the subject's life. There are even more possibilities (a nice example and discussion is in Breslow Day, the example being occupational exposure to nickel and later cancer). The Cox model works by comparing covariates for the observation that failed and other observations at risk at the same time, so the comparisons are entirely within time-point. If you use time since start of study you are comparing people with different covariates at the same time since start of study. If you use calendar time you are comparing people with different covariates at the same calendar time If you use age you are comparing people with different covariates at the same age. In an observational study it often is more important to control for age or for calendar time than for time since the study started, so these might be better time scales. A disadvantage in some studies with longitudinal data is that on the study time scale everyone may have measurements at the same time but on other time scales everyone may have measurements at different times. -thomas __ R-help@stat.math.ethz.ch 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.