[R] Mixed model

From: Stephen <szlevine_at_nana.co.il>
Date: Sun 26 Jun 2005 - 20:02:04 EST


Hi All,  

I am currently conducting a mixed model. I have 7 repeated measures on a simulated clinical trial. If I understand the model correctly, the outcome is the measure (as a factor) the predictors are clinical group and trial (1-7). The fixed factors are the measure and group. The random factors are the intercept and id and group.  

I tried using 2 functions to calculate mixed effects.

Following previous correspondence .  

Dataset <- read.table("C:/Program Files/R/rw2011/data/miss/model1a.dat", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)


require (nlme)

with(Dataset, table(runnb, id, grp))

b.lvls <- table(Dataset$runnb)

nb <- length(b.lvls)

fit <- vector(mode="list", nb)  

for(i in 1:nb)

 fit[[i]]<- lme (trans1 ~ Index1 + grp,

            random = ~ 1 | id / grp ,

            data = Dataset,

            na.action = "na.exclude")    

This (above) worked OK only I am having memory problems.

I have a gig of RAM set at --sdi --max-mem-size=512M (complete version below)

I am wondering if running the file as a database be slower / faster?  

Then I read that lme4 does it quicker and more accurately

so I thought that I should re-run the code but from the for line:  

> for (i in 1:nb)

+ fit[[i]] <- lmer(trans1 ~ Index1 + grp + (1|id:grp) + (1|id),

+ Dataset, na.action = na.exclude)  


Error in lmer(trans1 ~ Index1 + grp + (1 | id:grp) + (1 | id), Dataset, :

        flist[[2]] must be a factor of length 200000

In addition: Warning messages:

  1. numerical expression has 200000 elements: only the first used in: id:grp
  2. numerical expression has 200000 elements: only the first used in: id:grp

Any advice on the source and handling of this error would be appreciated?  

version: _

platform i386-pc-mingw32

arch i386

os mingw32

system i386, mingw32


major 2

minor 1.1

year 2005

month 06

day 20

language R

Windows XP Pro.

Many thanks


???? ?"? ???? ????

        [[alternative HTML version deleted]]

R-help@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 Received on Sun Jun 26 21:30:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST