Re: [R] help with coxme

From: Jing Hua Zhao <>
Date: Wed 05 Jul 2006 - 22:51:02 EST

Many thanks. I am actually able to check for this with S-PLUS 7 for Linux and obtained the same error message concerning kindex in coxme. It is thus worthwhile to give a note to the S-PLUS author before looking into the details. Best, JH

-----Original Message-----
From: Spencer Graves [] Sent: 03 July 2006 17:56
To: Lei Liu
Cc:; Jing hua Zhao Subject: Re: [R] help with coxme

          When I tried it, I seemed to get inconsistent results, the first of
which was irreproducible. The first error message said that 'rats2' was

not a data.frame. I don't know what I did to get that, but when I tried

it again, I got the following:

Error in max(kindex) : object "kindex" not found

 > traceback()
3: max(kindex)
2: max(kindex)
1: coxme(Surv(time, status) ~ rx + x2, data = rats2, random = ~(1 +
        x2) | litter)

	  This sounds to me like a logic error in 'coxme';  I am
cc-ing the maintainer listed in help(package='kinship').

          If it were my problem, I might list coxme and make a local copy of
it. It's easy to find the offending 'max(kindex)'. It's harder to figure out what kindex should be in this context. To attempt that, I might request debug(coxme), then try again the 'coxme' call that produced the error message and trace through it line by line until I figured it out.

	  Hope this helps.
	  Spencer Graves

Lei Liu wrote:
> Hi there,
> I have a question on fitting data by coxme. In particular I want to
fit a
> random intercept and random slope cox model. Using the rats dataset as
> example, I generated another covariate x2 and want to specify a random
> for x2. Here is my code:
> x2=matrix(rep(runif(50), 3), 50, 3)
> x2=as.vector(t(x2))
> rats2=cbind(rats, x2)
> But when I used the coxme function as follows, it gave an error
> What is the right way to do it? Thanks a lot!
> coxme(Surv(time, status) ~ rx+x2, data=rats2, random=~ (1+x2)|litter
> Lei Liu
> Assistant Professor
> Division of Biostatistics and Epidemiology
> Dept. of Public Health Sciences
> School of Medicine
> University of Virginia
> 3181 Hospital West Complex
> Charlottesville, VA 22908-0717
> 1-434-982-3364 (o)
> 1-434-806-8086 (c)
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Wed Jul 05 23:05:23 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 06 Jul 2006 - 00:16:50 EST.

Mailing list information is available at Please read the posting guide before posting to the list.