"validMBdataDE" <- function(object) { if(is.null(object@N) || is.na(object@N) || (object@N < 0) || (object@N != as.integer(object@N))) paste("@N must be a positive integer",sep="") else if(is.null(object@n) || is.na(object@n) || (object@n < 0) || (object@n != as.integer(object@n))) paste("@n must be a positive integer",sep="") else if(!all(c(length(object@IDs),nrow(object@M),nrow(object@W)) %in% object@N)) paste("Incompatible dimensions of some attributes (must all match @N)",sep="") else if(!all(c(ncol(object@M),ncol(object@W),nrow(object@design)) %in% object@n)) paste("Incompatible dimensions of some attributes (must all match @n)",sep="") else if(!is.numeric(object@M) || !is.numeric(object@W)) paste("@M and @W must be numeric",sep="") else if(!all(object@W >= 0,na.rm=TRUE) || !all(object@W <= 1,na.rm=TRUE)) paste("@W must be between 0 and 1, or NA",sep="") else if(!all(object@design %in% c(-1,0,1))) paste("@design must only consist of either 0, 1, or -1",sep="") else if(!(object@lmMethod %in% c("ls","robust"))) paste("@lmMethod can only be 'ls' or 'robust'",sep="") else if(is.null(object@prop) || is.na(object@prop) || !(object@prop >= 0) || !(object@prop <= 1)) paste("@prop must be between 0 and 1",sep="") else TRUE }