mip.sven | R Documentation |
This function computes the marginal inclusion probabilities of all variables from a fitted "sven" object.
mip.sven(object, threshold = 0)
object |
A fitted "sven" object |
threshold |
marginal inclusion probabilities above this threshold are stored. Default 0. |
The object returned is a data frame if the sven
was run with a single matrix,
or a list of two data frames if sven
was run with a list of two matrices.
The first column are the variable names (or numbers if column names of were absent).
Only the nonzero marginal inclusion probabilities are stored.
Somak Dutta
Maintainer:
Somak Dutta <somakd@iastate.edu>
n <- 50; p <- 100; nonzero <- 3
trueidx <- 1:3
truebeta <- c(4,5,6)
X <- matrix(rnorm(n*p), n, p) # n x p covariate matrix
y <- 0.5 + X[,trueidx] %*% truebeta + rnorm(n)
res <- sven(X=X, y=y)
res$model.map # the MAP model
mip.sven(res)
Z <- matrix(rnorm(n*p), n, p) # another covariate matrix
y2 = 0.5 + X[,trueidx] %*% truebeta + Z[,1:2] %*% c(-2,-2) + rnorm(n)
res2 <- sven(X=list(X,Z), y=y2)
mip.sven(res2) # two data frames, one for X and another for Z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.