[R] help with coxme

Spencer Graves spencer.graves at pdf.com
Mon Jul 3 18:56:18 CEST 2006


	  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 therefore 
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 an 
> example, I generated another covariate x2 and want to specify a random slope 
> 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 message. 
> 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)
> 
> liulei at virginia.edu
> ll9f at virginia.edu
> 
> ______________________________________________
> R-help at 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



More information about the R-help mailing list