nlme: failed augPred with NA in an unused column (PR#1745)

dieter.menne@menne-biomed.de dieter.menne@menne-biomed.de
Fri, 5 Jul 2002 08:32:33 +0200 (MET DST)


Full_Name: Dieter Menne
Version: 1.5.1
OS: win2000
Submission from: (NULL) (212.185.252.139)


nlme Version: 3.1-27

gsummary fails if any of the columns contains an NA.

 varying <- unlist(lapply(object, function(column, frst) {
        aux <- as.character(column)
        any(aux != aux[frst])
    }, frst = asFirst))
>>    if (any(varying) && (!invariantsOnly)) {

Error in if (any(varying) && (!invariantsOnly)) { : 
        missing value where logical needed

This probably is by design (an more verbose error message would help),
but as a consequence augPred also fails even if
the column is not used at all in the fit.
  
------------------------------------------------
library(nlme)
data(Orthodont)
# add a column with an NA that is not used in the fit
Orthodont$Others<-runif(nrow(Orthodont))
is.na(Orthodont$Others[3])<-T
fm1 <- lme(Orthodont, random = ~1)
augPred(fm1, length.out = 2, level = c(0,1))
--------------------------------------------------
#Error in if (any(varying) && (!invariantsOnly)) { : 
#        missing value where logical needed


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._