replication {BayesSAE}R Documentation

Replicated Data

Description

This function draws replicated data from posterior predictive distributions. With these replications, one can display graphical posterior checks or compute the Bayesian p-value to see whether the model fits the data well. See details in Gelman et. al (2006).

Usage

replication(object, repperdr = 1, ...)

Arguments

object

an object of class obtained by BayesSAE function.

repperdr

number of replicated data each posterior draw generated. See also Details.

...

currently not used

Details

Let θ denote all the parameters in the model, and θ^{i}, i = 0, 1, …, n be the n posterior draws. Supposing the argument repperdr is 5, and then 5 replications would be obtained from the distribution p(y|θ^{i}) for each i.

Value

m * k matrix of replicated data where m is the number of domains. Values are sorted as the direct estimators.

Author(s)

Chengchun Shi

References

You, Y. and Chapman, B. (2006) Small Area Estimation Using Area Level Models and Estimated Sampling Variances. Survey Methodology, 32: 97-103.

See Also

BayesSAE

Examples

#load data set
data(SAIPE)

#obtain MCMC draws
result <- BayesSAE(SACPR~SNAPR+CenPR+CPER|Vardir, data = SAIPE, mcmc = 5000)

#obtain replicated data
replication(result)

[Package BayesSAE version 1.0-2 Index]