Hi, I'm reading van Belle et al "Biostatistics" and trying to run a cox test using a dataset from: http://faculty.washington.edu/~heagerty/Books/Biostatistics/chapter16.html (Primary Biliary Cirrhosis data link at top of the page), I'm using the following code: --------------- start of code library(survival) liver <- scan("liver2.txt",list(age=0,albumin=0,alkphos=0,ascites=0,bili=0, cholest=0,edema=0,edmadj=0,hepmeg=0,obstime=0,platelet=0,protime=0, sex=0,sgot=0,spiders=0,stage=0,status=0,treatmnt=0, triglyc=0,urinecu=0)) fit<-coxph(Surv(obstime,status)~bili+edmadj+albumin+protime+age,data=liver) summary(fit) ----------------- End of code but the answer is rather different from that in the book (p.688 - for anyone with the book). The book refers to EDTRT, but the dataset has EDMADJ and EDMEMA, also the book talks about 312 patients and the dataset has 418 lines. Has anybody else used this dataset? Cheers, Geoff Russell
"Geoff Russell" <geoffrey.russell at gmail.com> writes:> Hi, > > I'm reading van Belle et al "Biostatistics" and trying to run a cox test using > a dataset from: > > http://faculty.washington.edu/~heagerty/Books/Biostatistics/chapter16.html > > (Primary Biliary Cirrhosis data link at top of the page), > > I'm using the following code: > > --------------- start of code > library(survival) > liver <- scan("liver2.txt",list(age=0,albumin=0,alkphos=0,ascites=0,bili=0, > cholest=0,edema=0,edmadj=0,hepmeg=0,obstime=0,platelet=0,protime=0, > sex=0,sgot=0,spiders=0,stage=0,status=0,treatmnt=0, > triglyc=0,urinecu=0)) > fit<-coxph(Surv(obstime,status)~bili+edmadj+albumin+protime+age,data=liver) > summary(fit) > ----------------- End of code > > but the answer is rather different from that in the book (p.688 - for > anyone with the book). > > The book refers to EDTRT, but the dataset has EDMADJ and EDMEMA, also > the book talks about 312 patients and the dataset has 418 lines. > > Has anybody else used this dataset?Have you looked at the pbc dataset that comes with the survival package? The documentation says 312 randomised and 108 unrandomised (which should be 106?). There are some peculiar differences, e.g.> table(liver$treatmnt,exclude=NULL)1 2 <NA> 157 153 108> table(pbc$trt, exclude=NULL)-9 1 2 106 158 154 (Thomas Lumley was involve in both the book and the package, so probably knows better.) -- 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 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Sun, 3 Sep 2006, Geoff Russell wrote:> Hi, > > I'm reading van Belle et al "Biostatistics" and trying to run a cox test > using a dataset from: > > http://faculty.washington.edu/~heagerty/Books/Biostatistics/chapter16.html > > (Primary Biliary Cirrhosis data link at top of the page), > > I'm using the following code: > > --------------- start of code > library(survival) > liver <- scan("liver2.txt",list(age=0,albumin=0,alkphos=0,ascites=0,bili=0, > cholest=0,edema=0,edmadj=0,hepmeg=0,obstime=0,platelet=0,protime=0, > sex=0,sgot=0,spiders=0,stage=0,status=0,treatmnt=0, > triglyc=0,urinecu=0)) > fit<-coxph(Surv(obstime,status)~bili+edmadj+albumin+protime+age,data=liver) > summary(fit) > ----------------- End of code > > but the answer is rather different from that in the book (p.688 - for > anyone with the book).A little further up the page (or on a previous page -- I don't have a printed copy with me) the example specifies that in the model BILI, ALBUMIN and PROTIME are log transformations of the data and AGE is in ten-year units. I must admit that the need to take the 312 records with value for treatment is not explicit in the book, though. If you try coxph(formula = Surv(obstime, status) ~ log(bili) + edmadj + log(albumin) + log(protime) + I(age/10), data = liver, subset = !is.na(treatmnt)) you will get something much more like the book. -thomas