Error message

  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in book_prev() (line 775 of /home3/gardeoi3/public_html/iamrandom/modules/book/book.module).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home3/gardeoi3/public_html/iamrandom/includes/common.inc).

resid.bayes

Fitted values of a regression are used to obtain residuals.  Residuals are created for every draw of the posterior. 
#input:  X (no as.factors allowed)
#output:  residual values - N by n  matrix

bayes.resid=function(reg2,X,y)
{   yy=matrix(y,nrow(reg2),length(y), byrow=T)
    residval=yy-t(X%*%t(reg2[,1:(ncol(reg2)-1)]))
    residval
}

### Example: need a lm.bayes() object called reg2
resid2=bayes.resid(reg2, X, y)