Learn R Programming

transreg (version 1.0.5)

weights.transreg: Extract Weights

Description

Extracts weights from an object of class [transreg].

Usage

# S3 method for transreg
weights(object, stack = NULL, ...)

Value

Returns weights. The output is a numerical vector with one entry for each source of co-data.

Arguments

object

object of class `transreg`

stack

character "sta" (standard stacking) or "sim" (simultaneous stacking)

...

(not applicable)

References

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. tools:::Rd_expr_doi("10.1093/bioinformatics/btad680"). (Click here to access PDF.)

See Also

This function is about weights for sources of prior effects. To extract weights for features (estimated regression coefficients), use [coef()].

Examples

Run this code
#--- 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)

Run the code above in your browser using DataLab