weights.transreg {transreg} | R Documentation |
Extract Weights
Description
Extracts weights from an object of class transreg.
Usage
## S3 method for class 'transreg'
weights(object, stack = NULL, ...)
Arguments
object |
object of class |
stack |
character "sta" (standard stacking) or "sim" (simultaneous stacking) |
... |
(not applicable) |
Value
Returns weights. The output is a numerical vector with one entry for each source of co-data.
References
Armin Rauschenberger, Zied Landoulsi, Mark A. van de Wiel, and Enrico Glaab (2023). "Penalised regression with multiple sets of prior effects". Bioinformatics (In press). doi:10.1093/bioinformatics/btad680 armin.rauschenberger@uni.lu
See Also
This function is about weights for sources of prior effects.
To extract weights for features (estimated regression coefficients),
use coef()
.
Examples
#--- 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)
[Package transreg version 1.0.2 Index]