simulate.eba: Simulate Responses from EBA Models

Description Usage Arguments Details Value See Also Examples

View source: R/EBA_fast.R

Description

Simulates responses from the distribution corresponding to a fitted eba model object.

Usage

1
2
## S3 method for class 'eba'
simulate(object, nsim, seed, pool = TRUE, ...)

Arguments

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

Details

Responses are simulated by rbinom with sizes taken from the original sample and probabilities computed from the model object.

Value

A paired-comparison matrix of (pooled) responses.

See Also

eba, boot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 elimination-by-aspects model

## Parametric bootstrap of goodness-of-fit test
LR.stat <- replicate(200, deviance(eba(simulate(eba1), A)))

hist(LR.stat, col="lightgray", border="white", freq=FALSE, breaks=20,
     xlim=c(0, 60), main="Parametric bootstrap")
curve(dchisq(x, df=eba1$goodness.of.fit["df"]), add=TRUE)
abline(v=deviance(eba1), lty=2)

eba documentation built on Jan. 13, 2021, 10:12 a.m.

Related to simulate.eba in eba...