1"fitted.vec2var" <- 2function(object, ...){ 3 if (!(class(object) == "vec2var")) { 4 stop("\nPlease, provide object of class 'vec2var' as 'object'.\n") 5 } 6 resids <- resid(object) 7 fitted <- object$datamat[, colnames(object$y)] - resids 8 colnames(fitted) <- paste("fit of", colnames(object$y)) 9 return(fitted) 10} 11