Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion R/predict.susie.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
#'
coef.susie <- function(object, ...) {
s <- object
return(c(s$intercept, colSums(s$alpha * s$mu) / s$X_column_scale_factors))
# Compute mappable effects
mappable_coef <- colSums(s$alpha * s$mu) / s$X_column_scale_factors

if (!is.null(s$theta)) {
total_coef <- mappable_coef + s$theta / s$X_column_scale_factors
} else {
total_coef <- mappable_coef
}

return(c(s$intercept, total_coef))
}

#' @title Predict outcomes or extract coefficients from susie fit.
Expand Down