get_betas | R Documentation |
Function to extract the estimates of the linear coefficients from an HPR model
get_betas(object = NULL, alpha = 0.05, var_names = NULL)
object |
The results object from a run of hpr for which a matrix Z was input. |
alpha |
The uncertainty level for the betas; the default is 0.05 (which corresponds to 95% credible intervals). |
var_names |
An optional character vector containing the variable names of the columns of Z. |
A dataframe with a row for each beta and columns:
the name of the variable, if var_names was used
the mean of the posterior samples of the beta
the median of the posterior samples of the beta
the alpha/2 percentile of the posterior samples of the beta
the 1-alpha/2 percentile of the posterior samples of the beta
X <- as.matrix(dat$Day, ncol = 1)
y <- dat$Temperature
Z <- as.matrix(dat$Aberration, ncol = 1)
mymodel <- hpr(y = y, X = X, Z = Z, family = "gaussian", beta_dist = "cauchy")
mybetas <- get_betas(mymodel, var_names = c("Aberration"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.