View source: R/posterior_samples.R
posterior_samples | R Documentation |
Extract posterior samples for all parameters.
posterior_samples(object, ...)
object |
an object of class |
... |
currently ignored. |
A matrix of posterior samples for the partial correlation. Note that if controlling for
variables (e.g., formula ~ age
), the matrix also includes the coefficients from each
multivariate regression.
# note: iter = 250 for demonstrative purposes
########################################
### example 1: control with formula ###
########################################
# (the following works with all data types)
# controlling for gender
Y <- bfi
# to control for only gender
# (remove education)
Y <- subset(Y, select = - education)
# fit model
fit <- estimate(Y, formula = ~ gender,
iter = 250)
# note regression coefficients
samps <- posterior_samples(fit)
hist(samps[,1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.