Hello all, thanks for your time and patience. I'm looking for a method in R to analyse the following data: Time to waking after anaesthetic for medical procedures repeated on the same individual.> str(mysurv)labelled [1:740, 1:2] 20 20 15 20 30+ 40+ 50 30 15 10 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:2] "time" "status" - attr(*, "type")= chr "right" - attr(*, "units")= chr "Day" - attr(*, "time.label")= chr "ORIENTATION" - attr(*, "event.label")= chr "FullyOrientated" mysurv is constructed from the following data: head(data.frame(MRN, ORIENTATION, FullyOrientated)) MRN ORIENTATION FullyOrientated 1 0008291 20 2 2 0008469 20 2 3 0008469 15 2 4 0010188 20 2 5 0013664 30 1 6 0014217 40 1 I had planned to use a Cox PH model to analyse time to waking (ORIENTATION 10, 15, 20 mins ....... 50 mins) and whether or not people (MRN) are fully awake within an hour (FullyOrientated). I've put GENDER, etc. into the model but I have the following bias: The procedure is repeated weekly on each individual (MRN), so each individual has 5-9 cases associated with them. Currently I am including these in the model as if they were independent. Is there a way to account for the non-independence of these waking times? I'm thinking of something similar to the NLMER package and Multilevel / Mixed Effects analysis as described in Pinheiro and Bates. I'd be appreciative of any help at all? Thanks again, R -- View this message in context: http://r.789695.n4.nabble.com/Multilevel-Survival-Analysis-Cox-PH-Model-tp3638278p3638278.html Sent from the R help mailing list archive at Nabble.com.
On Jul 1, 2011, at 10:10 AM, dunner wrote:> Hello all, thanks for your time and patience. > > I'm looking for a method in R to analyse the following data: > > Time to waking after anaesthetic for medical procedures repeated on > the same > individual. > >> str(mysurv) > labelled [1:740, 1:2] 20 20 15 20 30+ 40+ 50 30 15 10 ... > - attr(*, "dimnames")=List of 2 > ..$ : NULL > ..$ : chr [1:2] "time" "status" > - attr(*, "type")= chr "right" > - attr(*, "units")= chr "Day" > - attr(*, "time.label")= chr "ORIENTATION" > - attr(*, "event.label")= chr "FullyOrientated" > > mysurv is constructed from the following data: > > head(data.frame(MRN, ORIENTATION, FullyOrientated)) > > MRN ORIENTATION FullyOrientated > 1 0008291 20 2 > 2 0008469 20 2 > 3 0008469 15 2 > 4 0010188 20 2 > 5 0013664 30 1 > 6 0014217 40 1 > > > I had planned to use a Cox PH model to analyse time to waking > (ORIENTATION > 10, 15, 20 mins ....... 50 mins) and whether or not people (MRN) are > fully > awake within an hour (FullyOrientated). I've put GENDER, etc. into > the > model but I have the following bias: > > The procedure is repeated weekly on each individual (MRN), so each > individual has 5-9 cases associated with them. Currently I am > including > these in the model as if they were independent. > > Is there a way to account for the non-independence of these waking > times? > > I'm thinking of something similar to the NLMER package and > Multilevel / > Mixed Effects analysis as described in Pinheiro and Bates.Have you looked at the coxme package? -- David Winsemius, MD West Hartford, CT
Three comments: 1. If there is no right censoring (and it appears not), I would use lmer on the awakening times, glmer on the FullyOriented variable. That is, I agree with Burt. Another option is GEE models 2. If you want to use a Cox model, then you can a. Add "+ cluster(id)" to the model statement. This adds a robust variance, and is closely related to GEE. b. Use coxme to fit a mixed effects model. Terry Therneau
> Patients are either fully oriented or not (1 or 2) after an hour. Ifthey're> not, then the data is right censored.It doesn't look like right censored data to me, unless the time variable were "time to full orientation"; you labeled it "time to awake" which appears to be something different. However, to answer your coxme question the random effect would be (1| MRN/COURSE) which stands for a random intercept term for each course, and one for each mrn within course. This is the same notation as lmer. Terry Therneau