compute_effects {FBMS} | R Documentation |
Compute effects for specified in labels covariates using a fitted model.
Description
This function computes model averaged effects for specified covariates using a fitted model object. The effects are expected change in the BMA linear predictor having an increase of the corresponding covariate by one unit, while other covariates are fixed to 0. Users can provide custom labels and specify quantiles for the computation of effects.
Usage
compute_effects(object, labels, quantiles = c(0.025, 0.5, 0.975))
Arguments
object |
A fitted model object, typically the result of a regression or predictive modeling. |
labels |
A vector of labels for which effects are to be computed. |
quantiles |
A numeric vector specifying the quantiles to be calculated. Default is c(0.025, 0.5, 0.975). |
Value
A matrix of treatment effects for the specified labels, with rows corresponding to labels and columns to quantiles.
See Also
Examples
data <- data.frame(matrix(rnorm(600), 100))
result <- mjmcmc.parallel(runs = 2, cores = 1, data, gaussian.loglik)
compute_effects(result,labels = names(data)[-1])
[Package FBMS version 1.0 Index]