[R] augPred and NAs
Morten Gram Pedersen
Morten_Gram.Pedersen at med.lu.se
Mon Jan 24 15:04:40 CET 2011
I have a problem using augPred from the nlme package on a data set with NAs.
Consider this example, modified from the augPred help page:
> library(nlme)
> Orthodont[100,]$age=NA #### Insert NA somewhere in the data set
> fm1 <- lme(Orthodont, random = ~1,na.action=na.exclude) #### Can still fit with lme
> augPred(fm1) #### Error...!? Also with options "na.rm=T" or "na.action=na.exclude"
Error in if (from == to) rep.int(from, length.out) else as.vector(c(from, :
missing value where TRUE/FALSE needed
Any help on how to handle NAs in such cases is most appreciated. Neither Pinheiro & Bates nor Google helped...
Thanks,
Morten Pedersen
More information about the R-help
mailing list