Description Usage Arguments Value Methods (by generic)
Fit a Bayesian Hierarchical model to make 'shrinkage' estimation and impute missing values in aggregated data.
1 2 3 4 |
X_fix |
(numeric matrix) a model matrix (or design matrix) for fixed, non-hierarchical effects. We recommend using stats::model.matrix to generate this matrix. |
X_hier |
(integer/character/factor matrix) a indicator matrix of hierarchical effects. |
Y |
(numeric vector) an outcome vector. For |
Ysd |
(numeric vector) standard deviation for each observation. (required for |
Nsam |
(integer vector) population, or sample size for each observation. |
isDat |
(integer/logical vector) indicators which rows are observed ( |
model |
(character) the model type, one of "binomial" or "normal". |
... |
parameters for the sampling algorithm, such as
|
A HIfit
object containing the following components.
fit
: an object of S4 class rstan::stanfit.
dat
: a list of data passed rstan::sampling.
Y_obs
: a vector of observed outcomes. For model = "binomial"
, this will equal to Y/pop
. For For model = "normal"
, this will equal to Y
.
Y_est
: a data.frame of predicted outcomes, corresponding to obs
.
model
: model family, one of "binomial" or "normal".
plot
: Plot the observations versus the predictions of HIfit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.