Skip to content

Bayesian Model Averaging

2 messages · David S. Schwarz, Greg Snow

#
The problem is not with the BMA function, but rather that you have made the common mistake of forgetting that you are smarter than the computer.  The variable Y below is a data frame (not a single numeric vector).  Now a smart person like you sees a single column in the data frame and understands that is the y-variable, most intelligent people would do the same thing, but the computer is not as smart as you, it sees a data frame (a form of a list, which is what the error is talking about), knows that it wants a vector, but is not smart enough to figure out the only column of the data frame is the vector to use, so gives an error instead.

You can either read the data in as a vector, convert the data frame to a vector, or use subscripting/indexing to pass only the vector to the function (or maybe a 4th alternative that I have not thought of yet).

Hope this helps,