Skip to contents

R arm of morie.fn.bamse, bypvl and nocse. Bamse: posterior standard deviations (n - 1 denominator) of each column of an MCMC chain. Bypvl: posterior predictive p-value, the share of replicated test statistics at or above the observed one. Nocse: normal confidence half-widths z times the bootstrap standard errors of NOMINATE estimates.

Usage

Bamse(chain)

Bypvl(chain, test_stat)

Nocse(boot_se, alpha = 0.05)

Arguments

chain

MCMC draws (rows) by parameter (columns), or replicated statistics.

test_stat

Observed test statistic.

boot_se

Bootstrap standard errors.

alpha

Error rate.

Value

A named list (the Python result's fields).

References

Gelman, A., Meng, X.-L. and Stern, H. (1996). Posterior predictive assessment of model fitness via realized discrepancies. Statistica Sinica 6, 733-807.

Poole, K. T. and Rosenthal, H. (1997). Congress: A Political-Economic History of Roll Call Voting. Oxford University Press.

Examples

Bamse(cbind(c(1, 2, 4), c(5, 3, 4)))$ses
#> [1] 1.527525 1.000000
Bypvl(c(0.2, 1.5, 0.9, 2.2, 1.1), 1)$value
#> [1] 0.6