weights.transreg | R Documentation |
Extracts weights from an object of class [transreg].
## S3 method for class 'transreg'
weights(object, stack = NULL, ...)
object |
object of class 'transreg' |
stack |
character "sta" (standard stacking) or "sim" (simultaneous stacking) |
... |
(not applicable) |
Returns weights. The output is a numerical vector with one entry for each source of co-data.
Armin Rauschenberger, Zied Landoulsi, Mark A. van de Wiel, and Enrico Glaab (2023). "Penalised regression with multiple sets of prior effects". Bioinformatics 39(12):btad680. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btad680")}. (Click here to access PDF.)
This function is about weights for sources of prior effects. To extract weights for features (estimated regression coefficients), use [coef()].
#--- simulation ---
set.seed(1)
n <- 100; p <- 500
X <- matrix(rnorm(n=n*p),nrow=n,ncol=p)
beta <- rnorm(p)
prior <- cbind(beta+rnorm(p),beta+rnorm(p),rnorm(p),rnorm(p))
y <- X %*% beta
#--- example ---
object <- transreg(y=y,X=X,prior=prior)
weights(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.