## ....................................................................
# Generation of reponses (0,1) from r4pl() for N subjects (default value of N= 10)
gr4pl(c = 1)
gr4pl(N = 5, theta = c(-4, 4), c = 0)
# Generation of a 7 responses pattern (0,1) for [rep * length(theta)] subjects
# The subjects number is equal to [rep * length(theta)]]
# a,b,c et d are item parameters vectors
nitems <- 7
N <- 10
a <- rep(1, nitems)
b <- rnorm(nitems)
c <- rep(0, nitems)
d <- rep(1, nitems)
theta <- seq(-4,4,length=5)
x <- ggr4pl(n = nitems, rep = N, theta = theta, a = a, b = b, c = c, d = d)
x
## Probability of a 10 responses pattern and test caracteristic curve (TCC)
nitems <- 10
a <- rep(1,nitems)
b <- seq(-4,4,length=nitems)
c <- rep(0,nitems)
d <- rep(1,nitems)
N <- 3
theta <- seq(-1,1,length=12)
# Generation of the response patterns
x <- ggr4pl(n = nitems, rep = N, theta = theta, a = a, b = b, c = c, d = d)
x
# Without TCC
res <- pggr4pl(x=x, rep=N, theta=theta,a=a,c=c,d=d,TCC=FALSE); res
# With TCC for each response pattern
res <- pggr4pl(x=x, rep=N, theta=theta,a=a,c=c,d=d,TCC=TRUE); res
## ....................................................................
Run the code above in your browser using DataLab