The problem is that you are passing a function na.exclude()
to the correlation
argument of lme()
. In effect your call is:
model.a <- lme(Timmrec ~ age, data = apoeht, random = ~ age | pathid,
correlation = na.exclude)
The code that handles the correlation
argument makes certain assumptions, but it is certainly not expecting to be passed an irrelevant function.
You probably want to use the na.action
argument, but you must name it if you don't supply the other arguments. You want
model.a <- lme(Timmrec ~ age, data = apoeht, random = ~ age | pathid,
na.action = na.exclude)