ppp_binom {multinomineq} | R Documentation |
Posterior Predictive p-Values
Description
Uses posterior samples to get posterior-predicted frequencies and compare the Pearson's X^2 statistic for (1) the observed frequencies vs. (2) the posterior-predicted frequencies.
Usage
ppp_binom(prob, k, n, by)
ppp_multinom(prob, k, options, drop_fixed = TRUE)
Arguments
prob |
vector with probabilities or a matrix with one probability vector per row.
For |
k |
vector of observed response frequencies. |
n |
integer vector, specifying the number of trials for each binomial/multinomial distribution
Note that this is the |
by |
optional: a vector of the same length as |
options |
number of observable categories/probabilities for each item
type/multinomial distribution, e.g., |
drop_fixed |
whether the output matrix includes the last probability for each category (which is not a free parameter since probabilities must sum to one). |
References
Myung, J. I., Karabatsos, G., & Iverson, G. J. (2005). A Bayesian approach to testing decision making axioms. Journal of Mathematical Psychology, 49, 205-225. doi:10.1016/j.jmp.2005.02.004
See Also
sampling_binom
/sampling_multinom
to get
posterior samples and rpbinom
/rpmultinom
to
get posterior-predictive samples.
Examples
# uniform samples: p<.10
prob <- matrix(runif(300 * 3, 0, .1), 300)
n <- rep(10, 3)
ppp_binom(prob, c(1, 2, 0), n) # ok
ppp_binom(prob, c(5, 4, 3), n) # misfit
# multinomial (ternary choice)
prob <- matrix(runif(300 * 2, 0, .05), 300)
ppp_multinom(prob, c(1, 0, 9), 3) # ok