subgroup_average_posterior | R Documentation |
Aggregate posterior draws into subgroups by a factor
subgroup_average_posterior(posterior_samples, groups, weights = NULL)
posterior_samples |
A matrix of posterior samples, with MCMC draws down the rows |
groups |
A factor defining the desired subgroups. Must have length ncol(posterior_samples) |
weights |
Optional weights, for computing a weighted subgroup average |
Aggregate posterior draws into subgroups by a factor and return a new matrix of posterior draws for the subgroup (weighted) average
A matrix of size (number of MCMC samples) x (number of subgroups) containing posterior draws of the subgroup averages
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.