[R] Problem with groupedData and lme

Dieter Menne dieter.menne at menne-biomed.de
Fri Jul 3 09:21:01 CEST 2009




MUHC-Research wrote:
> 
> 
> I'm currently having trouble with the implementation of a groupedData 
> object in the lme() function.
> 
> Executing the following function
>> applyScalingSimp <- function(input.population)
>> {
>>         ## GA is a time value
>>         varInOrder <- c("GA","weight","grouping","sex")
> 

Your code is a bit lengthy, and it is always polite to post it in pastable
form without the <. So I did not test it, but looking at 

---
 lmeFormula <- as.formula(paste("VARI1", "~", modelVar["sex"],"+ (",
paste(colnames(GASpline),sep="",collapse="+"), ")|id")) groupFrame <-
groupedData(formula = lmeFormula, data = input.population)
----

this reminded me of an environmental problem with lme when the formula is
created dynamically in a function. You might check Ripley's game:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/16599.html

While Pinheiro/Bates gives the impression that grouped data are the way to
go, I always found it much easier to debug by not using these (and Douglas
Bates seems to agree, grouped data are gone in lme4). So I suggest that you
untangle your code by explicitly giving the structure in lme.

Dieter







-- 
View this message in context: http://www.nabble.com/Problem-with-groupedData-and-lme-tp24311547p24318778.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list