[R] Grouping Data for Repeated Measure Mixed Model
Tonker
claire_brittain at hotmail.com
Thu Nov 8 11:41:42 CET 2007
Hi
I am trying to run a mixed effects model taking into account that i sampled
in the same locations four times i.e. temporal repeated measures. From what
i gathered i need to group my data by my repeated measure - time - and state
the structure of my random variables so i tried this:
mixedmodel<-groupedData(response~time|randoma/randomb/subj,
outer=~fixeda+fixedb+fixedc+fixedd+fixede+fixedf, mixedmodel)
This went through ok and then i tried running the model:
mixmod1<-lme(reponse~fixeda+fixedb+fixedc+fixedd+fixede+fixedf,
data=mixedmodel, random=~time|randoma/randomb/subj)
I got there error term:
Error in na.fail.default(list(time= c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, :
missing values in object
There are no missing values in my time factor but taking out any NAs which
were in my data elsewhere i ran again and got:
Warning message:
Fewer observations than random effects in all level 3 groups
Subj was a factor i made by numbering each of my samples to represent the
lowest unit. I wondered if the reason i didnt have enough observations was
becasue i was working right down to my lowest unit so i took out subject
from my data grouping and model and tried again and got:
Error in logLik.lmeStructInt(lmeSt, lmePars) :
NA/NaN/Inf in foreign function call (arg 3)
In addition: There were 50 or more warnings (use warnings() to see the first
50)
I am new to both R and mixed models so am pretty lost as to where to go next
from here. Any help or suggestions would be greatly appreciated.
Thankyou in advance
--
View this message in context: http://www.nabble.com/Grouping-Data-for-Repeated-Measure-Mixed-Model-tf4770208.html#a13644765
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list