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).

fitted.bayes (+plot)

Fitted values of a regression using an lm.bayes() object
#input:  X (no factor variables allowed), this can be a new X matrix
#output:  fitted values - N by n matrix

fitted.bayes=function(reg2,X)
{   fitval=t(X%*%t(reg2[,1:(ncol(reg2)-1)]))
    fitval
}

### Example: first need to use lm.bayes() to create a regression: "reg2"
fits2=fitted.bayes(reg2, X)
### Make a plot out of the fitted values: include a mean fit and 95% PI bands
fits3=apply(fits2,2,sort)
plot(x,y)
lines(x,fits3[.025*qq,], col=2)
lines(x,fits3[.975*qq,],col=2)
lines(x,fits3[.50*qq,],col=2)

File: 
Regression fit