Description Usage Arguments Value Examples
Simulation based p value to observe x or more picks of the data plot in K evaluations of a multiple choice lineup test under the assumption that the data plot is consistent with the null hypothesis. We distinguish between three different scenarios:
Scenario I: in each of K evaluations a different data set and a different set of (m-1) null plots is shown.
Scenario II: in each of K evaluations the same data set but a different set of (m-1) null plots is shown.
Scenario III: the same lineup, i.e. same data and same set of null plots, is shown to K different observers.
1 2 3 4 5 |
x |
(vector) of the number of observed data picks |
K |
integer value, specifying the number of participants/evaluations |
k |
(vector) of integer values of the number of observed picks in a multiple choice lineup evaluation |
m |
lineup size, defaults to m=20 |
type |
character, one of "scenario1", "scenario2", or "scenario3" |
N |
integer value, number of simulations. |
q |
(vector) of the number of observed data picks |
list consisting of two named items:
dmulti: density estimates and vector k
pmulti: distribution estimates and vector k
qmulti: quantile estimates and vector k
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | k=rpois(5,lambda=1)+1
m=20
dmulti(0:5,K=5,k=k, type="scenario1", m)
## compare to Poisson Binomial:
library(poibin)
dpoibin(0:5, pp=k/m)
qmulti(c(0.95, 0.99), K=5, k=2)
## Not run:
(k <- rpois(5, lambda=1.5)+1)
reps1 <- plyr::ldply(1:10, function(x) dmulti(0:5, 5, k, type="scenario1")$density)
reps2 <- plyr::ldply(1:10, function(x) dmulti(0:5, 5, k, type="scenario2")$density)
reps3 <- plyr::ldply(1:10, function(x) dmulti(0:5, 5, k, type="scenario3")$density)
reps1$type <- "I"
reps2$type <- "II"
reps3$type <- "III"
reps <- rbind(reps1, reps2, reps3)
library(reshape2)
library(RColorBrewer)
cols <- brewer.pal(8, "Paired")
mr <- melt(reps, measure.vars=1:6)
mr$variable <- as.numeric(gsub("V", "", mr$variable))
mr$type <- factor(mr$type)
mr$offset <- with(mr, 0.1*c(0,-1,1)[as.numeric(type)])
qplot(variable+offset, value, data=mr, alpha=I(0.75), colour=type) +
geom_point(aes(x=1:6, y=dpoibin(0:5, pp=k*1/m)), pch=1, size=4,
inherit.aes=FALSE)+
xlab("x")+ylab("P(X=x)")+ggtitle(paste(k, collapse=",")) +
theme_bw() + scale_colour_manual(values=cols[-c(1,3,5,6,7)])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.