simulate.eba {eba} | R Documentation |
Simulates responses from the distribution corresponding to a fitted
eba
model object.
## S3 method for class 'eba': simulate(object, nsim, seed, pool, ...)
object |
an object of class eba , typically the result of a
call to eba |
nsim |
currently not used |
seed |
currently not used |
pool |
logical, if TRUE (default), pooled responses (summed across respondents) are returned |
... |
further arguments passed to or from other methods. None are used in this method. |
Responses are simulated by rbinom
with sizes taken from the
original sample and probabilities computed from the model object.
A paired-comparison matrix of (pooled) responses.
data(celebrities) # absolute choice frequencies A <- list(c(1,10), c(2,10), c(3,10), c(4,11), c(5,11), c(6,11), c(7,12), c(8,12), c(9,12)) # the structure of aspects eba1 <- eba(celebrities, A) # fit EBA model lrt <- numeric(200) # performs a parametric bootstrap for(i in 1:200) lrt[i] <- eba(simulate(eba1), A)$good[1] hist(lrt, col="lightgrey", border="white", freq=FALSE, breaks=20, xlim=c(0, 60), main="Parametric bootstrap") curve(dchisq(x, df=eba1$good[2]), add=TRUE) abline(v=eba1$good[1], lty=2)