Skip to contents

Given the fitted values from a Bayesian model and (a subset of) covariates of interest, compute the optimal linear coefficients. This applies for continuous (use_ols = TRUE) or binary (use_ols = FALSE) outcomes.

Usage

get_coefs(y_hat, XX, use_ols = TRUE)

Arguments

y_hat

n vector of fitted values at the given XX covariate values

XX

n x p matrix of covariates (e.g., restricted to the subset of p variables of interest)

use_ols

logical; if TRUE, use ordinary least squares regression (default); otherwise use logistic regression

Value

the p optimal regression coefficients