Description Usage Arguments Details Value Author(s) References See Also Examples
This function simulates data according to the Nested Logit Model.
1 | NLM.sim(Parlist, pp)
|
Parlist |
A list of numerical vectors with item parameters has to be committed. Note that the zeta parameters as well as the lambda parameters have to add up to 0 for each item. For details concerning the structure of the list see section 'Details'. |
pp |
A numerical vector of person parameters. |
The structure of the Parlist is as follows:
Vector for Item 1: c(slope, intercept, zeta1, zeta2, ..., lambda1, lambda2, ...)
Vector for Item 2: c(slope, intercept, zeta1, zeta2, ..., lambda1, lambda2, ...)
etc.
The function returns a length(pp)
*length(Parlist)
data.frame.
Manuel Reif
Suh, Y., & Bolt, D. M. (2010). Nested logit models for multiple-choice item response data. Psychometrika, 75, 454-473.
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 | # item parameters
Item1 <- c(1,-2,c(-0.5,0.3,0.2),c(-0.5,-0.3,0.8))
names(Item1) <- c("a","b",paste("zeta1",1:3,sep=""),paste("lamb",1:3,sep=""))
Item2 <- c(1,-1,c(-0.5,-0.3,0.8),c(-0.5,0.3,0.2))
names(Item2) <- c("a","b",paste("zeta1",1:3,sep=""),paste("lamb",1:3,sep=""))
Item3 <- c(1,0,c(-0.5,-0.3,0.8),c(-0.5,0.3,0.2))
names(Item3) <- c("a","b",paste("zeta1",1:3,sep=""),paste("lamb",1:3,sep=""))
Item4 <- c(1,1,c(-0.5,-0.3,0.8),c(-0.5,0.3,0.2))
names(Item4) <- c("a","b",paste("zeta1",1:3,sep=""),paste("lamb",1:3,sep=""))
Item5 <- c(1,2,c(-0.5,-0.3,0.8),c(-0.5,0.3,0.2))
names(Item5) <- c("a","b",paste("zeta1",1:3,sep=""),paste("lamb",1:3,sep=""))
ParList <- list(Item1=Item1,Item2=Item2,Item3=Item3,Item4=Item4,Item5=Item5)
# person parameters
pp <- rnorm(1000)
# simulate
sim.nlm.1 <- NLM.sim(ParList,pp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.