subgroup_average_posterior.Rd
Aggregate posterior draws into subgroups by a factor
subgroup_average_posterior(posterior_samples, groups, weights = NULL)
A matrix of posterior samples, with MCMC draws down the rows
A factor defining the desired subgroups. Must have length ncol(posterior_samples)
Optional weights, for computing a weighted subgroup average
A matrix of size (number of MCMC samples) x (number of subgroups) containing posterior draws of the subgroup averages
Aggregate posterior draws into subgroups by a factor and return a new matrix of posterior draws for the subgroup (weighted) average