which.matrix | R Documentation |
This function coerces the list object of models to a matrix and fill in the zeros to facilitate other computations.
which.matrix(which, n.vars)
which |
a 'bas' model object |
n.vars |
the total number of predictors, |
which.matrix
coerces
x$which
into a matrix.
a matrix representation of x$which
, with number of rows equal
to the length of which.models or total number of models and number of
columns x$n.vars
Merlise Clyde clyde@duke.edu
bas
Other as.matrix methods:
list2matrix.bas()
,
list2matrix.which()
data(Hald)
Hald.bic <- bas.lm(Y ~ ., data=Hald, prior="BIC", initprobs="eplogp")
# matrix of model indicators
models <- which.matrix(Hald.bic$which, Hald.bic$n.vars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.