Hello everyone,

I am completely new to the community and a novice in running Bayesian models. My question pertains to a set of matrices that I have collected and standardized from across many countries and years. Each matrix represents the total health spending in a given country year and is broken-down by the two dimensions - health spending by types of providers (~20 columns) and health spending by types of services (~20 rows). The sum of the rows must equal the sum of the columns. These matrices have varying levels of completeness (ranging form only totals - where cross-tabulations are completely empty - to nearly complete cross-tabulations).

Using the rstanarm package, I am currently able to predict cell-specific estimates across the countries and years, however, I am not sure how to incorporate the constraints that the sum of the rows must equal the sum of the columns. Has anyone added similar constraints to their models?

Thanks so much,

Matt