Re: [R] coxme - fitting random treatment effect nested within centre

From: Terry Therneau <therneau_at_mayo.edu>
Date: Wed, 05 Mar 2008 08:16:25 -0600 (CST)

I am using "coxme" function in Kinship library to fit random treatment effect nested within centre. I got 3 treatments (0,1,2) and 3 centres. I used following commands, but got an error.

> ugroup=paste(rep(1:3,each=3),rep(0:2,3),sep='/')
>
mat1=bdsmatrix(rep(c(1,1,1,1,1,1,1,1,1),3),blocksize=rep(3,3),dimnames=list(ugro up,ugroup))
>

mat2=bdsmatrix(rep(c(0,0,0,0,0,0,0,0,1),3),blocksize=rep(3,3),dimnames=list(ugro up,ugroup))
> group=paste(dat1$centre,dat1$treat,sep='/')
> coxme(Surv(time,status) ~ as.factor(treat), data=dat1,random=
~1|group,varlist=list(mat1,mat2),rescale=F,pdcheck=FALSE)

Error in coxme.fit(X, Y, strats, offset, init, control, weights = weights, : Random effects variance is not spd  

Could anyone help me correcting this error? Many thanks in advance.
Ruwanthi

 The "build your own bdsmatrix" style in coxme is for variance structures that are not built in, like pedigree data. Your problem is one that coxme can do directly, so it is easier to call the routine simply:  

  fit <- coxme(Surv(time, status) ~ factor(treat), data=data1,

  	         random = ~1 | centre/treat)
  	       
	Terry Therneau

______________________________________________
R-help_at_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. Received on Wed 05 Mar 2008 - 14:28:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Mar 2008 - 14:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive