Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

Re: [R] Problem with groupedData and lme

Dieter Menne

2009-07-03

Replies: Find Java Web Hosting

Author LoginPost Reply



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







--
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.